Sunshyneyellow G
Sunshyneyellow G

Reputation: 1

MS Access 2013 DoCmd for on click function returns error

Shows the number to be clicked and the resulting form that opens

Simply put...I am trying to open a specific record based on the record number that is clicked in the form. From a search criteria form, clicking "Search" opens another form in database view listing the search results. On click of the record number, I need that specific record to open in the assigned form.

Note:

My brain has melted several times over the past two days searching for a fix.

Here is the code I am using:

>DoCmd.OpenForm "QPF-45 (11/2012)", , , "VDMR_Number =" & Me.VDMR__

Upvotes: 0

Views: 52

Answers (1)

Gustav
Gustav

Reputation: 55806

VDMR Number, the code didn't work without the underscore in between

Neither did it with the underscore, because that's not a field name of yours.

So, either change the field name to not have a space, or wrap it in brackets:

 DoCmd.OpenForm "QPF-45 (11/2012)", , , "[VDMR Number] =" & Me.VDMR__

And refrain from using unreadable control names like "VDMR__"

Upvotes: 1

Related Questions