HelpNewtoAccess
Member
- Local time
- Today, 07:10
- Joined
- Dec 13, 2019
- Messages
- 79
How would I define the variables for this code? The BldgAbb_ID is text so I would set it to string but where would I go form here? I am opening a report based on the building abbreviation of a form. Thanks in advance for your help.
Code:
Option Compare Database
Option Explicit
Dim BldgAbb_ID As String
Private Sub cmdElev_Click()
On Error GoTo cmdElev_Click_Err
DoCmd.OpenReport "rptElevators", acViewReport, "", "[BldgAbb_ID]=" & "'" & BldgAbb_ID & "'", acNormal
cmdElev_Click_Exit:
Exit Sub
cmdElev_Click_Err:
MsgBox Error$
Resume cmdElev_Click_Exit
End Sub
Last edited by a moderator: