Subform Issue

P

Pat Backowski

Hi Everyone,

I'm calling a form from a form and passing the value of Route to limit the
inputs to the next form which is bound to a table with the key RouteX:

MsgBox (Me.Route)
DoCmd.OpenForm "VansIII", , , "[RouteX]=" & Me.Route

The Msgbox shows the correct value, but I keep getting a Parameter box
popping up asking for the value of "LIM" or "DUB", which is the value of
Me.Route.

I'm a very confudes lad, been over this 50x with no change.
Can anyone please help.

Thanks in Advance,
Pat.
 
A

Allen Browne

If the value is "LIM", then RouteX must be a Text field.

You need additional quotes:
DoCmd.OpenForm "VansIII", , , "[RouteX] = """ & Me.Route & """"

For an explanation of the quotes, see:
Quotation marks within quotes
at:
http://allenbrowne.com/casu-17.html
 
Top