There is something odd (and probably simple) I can't figure out on my form. I originally designed it with a command button which would open a report showing only the current record. I started with the following code:
Dim strWhere As String
DoCmd.RunCommand acCmdSaveRecord
stDocName = "repRejNotice"
strWhere = "[RejPartQty]=" & Me!RejPartQty
DoCmd.OpenReport stDocName, acPreview, , strWhere
where RejPartQty is a number. This worked, but it reported all records that had the same qty that was active, i.e. if the current record had a qty of 5, the report listed all other records with a qty of 5, too.
To get around this, I'm trying to replace the qty field with my autonumber, RejAutoNum. My string statement is now:
strWhere = "[RejAutoNum]=" & Me!RejAutoNum
When I click the command button, this now prompts me to input a RejAutoNum value, then reports all records regardless of what value I put in.
Is this a formatting problem, or is there a problem with using an autonumber (and my primary key) for this function?
Thanks in advance!
Dim strWhere As String
DoCmd.RunCommand acCmdSaveRecord
stDocName = "repRejNotice"
strWhere = "[RejPartQty]=" & Me!RejPartQty
DoCmd.OpenReport stDocName, acPreview, , strWhere
where RejPartQty is a number. This worked, but it reported all records that had the same qty that was active, i.e. if the current record had a qty of 5, the report listed all other records with a qty of 5, too.
To get around this, I'm trying to replace the qty field with my autonumber, RejAutoNum. My string statement is now:
strWhere = "[RejAutoNum]=" & Me!RejAutoNum
When I click the command button, this now prompts me to input a RejAutoNum value, then reports all records regardless of what value I put in.
Is this a formatting problem, or is there a problem with using an autonumber (and my primary key) for this function?
Thanks in advance!