Open form using non PK field

Locopete99

Registered User.
Local time
Today, 07:13
Joined
Jul 11, 2016
Messages
163
Hi Guys,

Its been a long day so i might be being stupid.

Can you open a form using the Docmd.openform command, but not use the PK index field?

I have a machine table and a field that is Symbol on machine but I cannot get it to open:

Code:
ID2 = InputBox("Enter Symbol or # on layout")
DoCmd.OpenForm "Frm_Machine", acNormal, , "Me.symbol=" & ID2

The symbol field is a short text field.

What am i doing wrong?
 
symbol field is a short text field
How about an example?
What is ID2? a string?

Perhaps
Code:
DoCmd.OpenForm "Frm_Machine", acNormal, , "Me.symbol=[COLOR="Red"]'[/COLOR]" & ID2 & "[COLOR="red"]'[/COLOR]"
 
Thanks guys, I'd forgotten to put the right syntax as per jdraw
 
I think you got the Me. wrong, you should try:

Code:
DoCmd.OpenForm "Frm_Machine", acNormal, , "Symbol='" & [COLOR="Red"][B]Me.[/B][/COLOR]ID2 & "'"

Cheers,
Vlad
 
Nope, ID2 is the text input field not one of my table fields, so pretty sure that wasn't it.

Anyway, its solved now thanks to Jdraw
 

Users who are viewing this thread

Back
Top Bottom