Hello all
I am working on fire dispatch form for our service and have run into a snag with Hide/Unhide macros when transfering data from a form to a report.
What I have on the form is 3 option buttons that will hide or unhide certain fields as it pertains to different call types. Although these work fine, I have made a mirror image of the form in a report and have a command button transfering all the data to the report. The problem I am having, is trying to find a code that will distinguish which fields are hidden and which are not. Once the report has been created, I would then export it as a snapshot so it can be emailed to the girls at the office for processing. The code I have for transfering data was from a user here named Rusty and it looks like this:
Private Sub command703_Click()
On Error GoTo Err_command703_Click
'*** open the report
DoCmd.OpenReport "report name", acPreview, , "[SS#] like '" & Me![SSNum] & "'"
'*** [SS#] is the Control Source name of the field on the report
'*** [SSNum] is the field name as it appears on the form
Exit_command703_Click:
Exit Sub
Err_command703_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click
End Sub
This code works great. I hope I have made a clear discription of what I am aiming for. If not please let me know, and if needed I can post my DB and hopefully it might help.
Great Thanxs ahead of time
JDS
I am working on fire dispatch form for our service and have run into a snag with Hide/Unhide macros when transfering data from a form to a report.
What I have on the form is 3 option buttons that will hide or unhide certain fields as it pertains to different call types. Although these work fine, I have made a mirror image of the form in a report and have a command button transfering all the data to the report. The problem I am having, is trying to find a code that will distinguish which fields are hidden and which are not. Once the report has been created, I would then export it as a snapshot so it can be emailed to the girls at the office for processing. The code I have for transfering data was from a user here named Rusty and it looks like this:
Private Sub command703_Click()
On Error GoTo Err_command703_Click
'*** open the report
DoCmd.OpenReport "report name", acPreview, , "[SS#] like '" & Me![SSNum] & "'"
'*** [SS#] is the Control Source name of the field on the report
'*** [SSNum] is the field name as it appears on the form
Exit_command703_Click:
Exit Sub
Err_command703_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click
End Sub
This code works great. I hope I have made a clear discription of what I am aiming for. If not please let me know, and if needed I can post my DB and hopefully it might help.
Great Thanxs ahead of time
JDS