I was wondering if you could help me with a little problem, at least I thought and think it must be simple, but it has cost me hours so far because I thought I'll be able to figure it out somehow...
I made my access "database" pretty simple:
- One Table with all the data needed
- One Form - where people will put in data (additionally a button: cmdPrint and a scond one "done" (doubleclick) so that a new empty form reloads.)
- One Report (opens onClick "cmdPrint")
My little problem is: I only want the actual data to be printed and that's my code:
Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click
DoCmd.OpenReport "MarketReport", , , "MarketID =" & Me!MarketID
Exit_cmdPrint_Click:
Exit Sub
Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click
End Sub
It seems to work:
- It does print 1 page with all the fields, but they are empty!
- the weirdest thing ever... it did work 1 to 2 times with the correct data but even though I havent changed ANYTHING, it doesn't work anymore, the fields are empty. Right after it worked, I made a backup of the file but it doesn't work on the original nor on the backup up file anymore) It just shows empty fields.
- I do have Autonumber (Fieldname = MarketID)
Table:
"Fieldname" = MarketID (data type: Autonumber)
Form:
"control element" = MarketID
Report:
"control element" = MarketID
(sorry, it's probably not control element, I am not sure what it is called in English)
Thank you so much for your help!
Sammy