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