syntax problem

sdawson

Registered User.
Local time
Today, 22:56
Joined
Apr 22, 2003
Messages
165
I've got a problem with the following syntax.
This code is a Click event in the form property.
I'm trying to open a form that has the same name as the field [Style] but can not get the syntax right.
The field [Style] can be one an number of options with a form of the same name.
The criteria works fine.

Dim stDocName as String
Dim stLinkCriteria as String

stDocName = [Style]
stLinkCriteria = "ID =Forms!stDocName!ID +1"

DoCmd.OpenForm stDocName, , , stLinkCriteria

The problem is how do I get the variable stDocName recognised in the DoCmd statement.
 
Don't understand your use of maths on a form's name bu

stLinkCriteria = "ID = " & Forms(stDocName).ID + 1
 

Users who are viewing this thread

Back
Top Bottom