Nico thanks for the advise so far it's been very helpful.
No joy when i inserted the break point and used F8 to skip down the line in the code however it didn't seam to have an effect.
I've created the Dcount function in a query to check it's correct, it worked fine.
I then removed the IF statement and left the macro, my thinking was the macro should have run however it didn't.
Here's the preceding code:
'go to last record, this line is probably not needed however my code works with it, so i left it in
- DoCmd.GoToRecord , , acLast
'insert new record
- DoCmd.GoToRecord , , acNewRec
'I run an update query to pair up details from a external excel file with the item selected in the form, i turn off then on warnings so the user doesn't have to repeatedly check ok
- DoCmd.SetWarnings False
-
stDocName = "10pcksStickerDescription"
-
DoCmd.OpenQuery stDocName, acNormal, acEdit
-
DoCmd.SetWarnings True
'i had ' out the IF statement to check if the macro ran here, however it didn't
- 'If (DCount("printed", "10pkBoxLabels", "printed = False") > 10) Then
-
stDocName = "Open10pkLabelMacro"
-
'stDocName = "UpdatePrintedQuery"
-
'End If
I then moved the IF portion to run after an update, still no joy.
I then removed the update query that matches the external data, however it still appears the IF statement does not run.
I'm really lost here as to why something that appears to be correct is not getting picked up when the code is ran?
Any advise or explanation of whats happening would be very much appreciated.