Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2008

Tip: Looking for answers? Try searching our database.

opening a related form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dosima - 29 Mar 2008 18:14 GMT
Hi i have a main form with cutomer details, and i want there to be a related
popup form where users can enter customers bank details.
i have tried to do this but cannot get it to work.

i have a customer table and a bank table. at the moment the relationship is
one customer has many bank details. i;m not sure if this correct though.

Also not every customer will have bank details so some popup forms will be
blank.
But the main problem is that i cant work out how to make the popup form only
show that certain customers bank details when on that customers record.

if anyone could help, that would be great
thanks
Arvin Meyer [MVP] - 30 Mar 2008 12:28 GMT
DoCmd.OpenForm "frmName",,,"CustomerID=" & Me.txtCustomerID

where:

frmName is the form's name
CustomerID is the field name
txtCustomerID is the text control name
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

> Hi i have a main form with cutomer details, and i want there to be a
> related
[quoted text clipped - 13 lines]
> if anyone could help, that would be great
> thanks
dosima - 30 Mar 2008 16:27 GMT
Hi

i have put this code in the customer form. When i click the button it tells
me to enter a parameter value Me.txtCustomerID.

Can you tell me what i need to do so it doesnt come up with this message. Am
i suppose to put anything on the Bank popup form.

Thanks

> DoCmd.OpenForm "frmName",,,"CustomerID=" & Me.txtCustomerID
>
[quoted text clipped - 20 lines]
> > if anyone could help, that would be great
> > thanks
Rick Brandt - 30 Mar 2008 16:57 GMT
> Hi
>
> i have put this code in the customer form. When i click the button it
> tells me to enter a parameter value Me.txtCustomerID.

Do you have a field on the form named txtCustomerID?  Does your code's
structure (quotes mostly) look exactly like what Arvin posted or just
similar?

When you have it correct you will not be prompted for a parameter.

Signature

Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt   at   Hunter   dot   com

dosima - 30 Mar 2008 18:52 GMT
Hi
I do have a field on the bmain form named CustomerID.
I have a text feld named txtCustomerID on the bank popup form.
the Structure is like what Arvin quoted - apart from the form name changed
to the correct form name.

Have i created it the correct place - it is in a macro that opens frmBank
and the other part CustomerID=" & Me.txtCustomerID is in the where part.

> > Hi
> >
[quoted text clipped - 6 lines]
>
> When you have it correct you will not be prompted for a parameter.
Arvin Meyer [MVP] - 30 Mar 2008 20:27 GMT
txtCustomerID is being called from the main form (the form where the button
resides), CustomerID is the field in the recordset which is in the
recordsource of the popup form. So try CustomerID instead of txtCustomerID

BTW, I assumed that the CustomerID field is an autonumer (Long Integer). If
it is text, the code would read:

DoCmd.OpenForm "frmName",,,"CustomerID=" & "'" & Me.CustomerID & "'"

> Hi
> I do have a field on the bmain form named CustomerID.
[quoted text clipped - 15 lines]
>>
>> When you have it correct you will not be prompted for a parameter.
Arvin Meyer [MVP] - 30 Mar 2008 18:42 GMT
txtCustomerID is a placeholder, as is frmName, and CustomerID. You must
supply your own names.
Signature

Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

> Hi
>
[quoted text clipped - 35 lines]
>> > if anyone could help, that would be great
>> > thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.