1. I do everything via VBA (code)
2. Do you understand how your Macro works?
3. There is a free version of SQL Server... SQL Server Express
1. Stick with what you know...
2. Hmm, whichever works better for you. I don't use a report, I instead allow that information to viewed on screen.
="[atRecordID]=" & [eEmployeeID]
DoCmd.OpenReport "r_AuditTrail_eJobTitle",acViewReport,,"[atRecordID]=" & [eEmployeeID]
WOW! I just got this notification today...
Are those ID fields numeric or text?
Hmm, don't know why I didn't spot this to begin with, look at the example below and make the appropriate changes...
Code:DoCmd.OpenReport "YourReport", acViewPreview, , "[FieldInReport]=" & Me![ControlOnForm]
Private Sub Command809_Click()
DoCmd.OpenReport "r_AuditTrail_eJobTitle", acViewPreview, , "[atRecordID]=" & Me![eEmployeeID]
End Sub
Run-time error '3075':
Syntax error (missing operator) in query expression '[atRecordID]='.
Is the NAME of your Control on your Form?
Or the name of the Control Source? And... is there an Employee ID there or is it empty?Code:Me![eEmployeeID]
Yes, that is the problem... it's empty. You will need to write code for it to ignore that line is the Control Source is empty.
Private Sub Command809_Click()
If Me.eEmployeeID = "" Then
End If
DoCmd.OpenReport "r_AuditTrail_eJobTitle", acViewPreview, , "[atRecordID]=" & Me![eEmployeeID]
End Sub
Private Sub Command809_Click()
If Me.eEmployeeID = "" Then
MsgBox "Cannot open report without Employee Data", vbInformation, "No data"
End If
DoCmd.OpenReport "r_AuditTrail_eJobTitle", acViewPreview, , "[atRecordID]=" & Me![eEmployeeID]
End Sub
DoCmd.OpenReport "r_AuditTrail_eJobTitle", acViewPreview, , "[atRecordID]=" & Me![eEmployeeID]
Hmm, not quite, it will still print, try...
Code:If Me.eEmployeeID = "" Then Exit Sub DoCmd.OpenReport "r_AuditTrail_eJobTitle", acViewPreview, , "[atRecordID]=" & Me![eEmployeeID]
Run-time error '3075':
Syntax error (missing operator) in query expression '[atRecordID]='.
I will look later today... it's 2:40 am where I am!
Side note, I will be away all next week. While I will have access to eMail it will be sporadic so you might be waiting a bit for answers.![]()