Having issues with DoCmd.OpenForm (1 Viewer)

DanielR

Registered User.
Local time
Today, 14:09
Joined
Mar 16, 2018
Messages
72
Having issues with DoCmd.OpenForm. I specify a search criteria, no errors pop up and when the form opens it goes to a new record. Also, the filter option at the bottom of the page turns yellow. When I click on it, it goes to the first record in the database, click again and it goes to the queried record that I specified in the OpenForm command.

Have no idea how to solve this...need help.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:09
Joined
May 7, 2009
Messages
19,246
What is your docmd.openform?

Did you out the criteria as 3rd parameter (3rd comma)
 

DanielR

Registered User.
Local time
Today, 14:09
Joined
Mar 16, 2018
Messages
72
My code is as follows:

strCriteria = "[Project Name]='" & Combo8 & "'"
DoCmd.OpenForm "Projects", , , stCriteria
Forms!Projects.SetFocus
 

Ranman256

Well-known member
Local time
Today, 17:09
Joined
Apr 9, 2015
Messages
4,337
docmd.openform is very simple....

'view all records
docmd.openform "MyForm"

'view 1 record from another form
docmd.openform "MyForm",,,"[id]=" & me.txtID

make sure the form design does NOT have set: DATAENTRY = YES
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:09
Joined
May 7, 2009
Messages
19,246
What us ur combos rowsource? Which column is it Bound?
 

DanielR

Registered User.
Local time
Today, 14:09
Joined
Mar 16, 2018
Messages
72
Wow, it was because Data Entry was set to Yes...Thank you.
 

Users who are viewing this thread

Top Bottom