Good afternoon (for those in the Atlantic Time Zone),
This is more of a curiosity, so if it's not possible it's not the end of the world...
I was wondering how I could do a multiple value InputBox in VBA, if this is even possible... This is so I can prompt the end user to enter a range (with two string values as start and end parameters) for a report I'm working on.
If this is possible, I would like to include this as an additional parameter option within the code I have below (which is working great thus far):
Like I said, if not possible then no worries... I'll just create a form to do this.
This is more of a curiosity, so if it's not possible it's not the end of the world...
I was wondering how I could do a multiple value InputBox in VBA, if this is even possible... This is so I can prompt the end user to enter a range (with two string values as start and end parameters) for a report I'm working on.
If this is possible, I would like to include this as an additional parameter option within the code I have below (which is working great thus far):
Code:
Private Sub EmployeesBadges_Click()
Dim soa As Byte
Dim emp, sEB As String
soa = MsgBox("Do you wish to print a single employee badge or all?", vbYesNo + vbQuestion)
Select Case soa
Case vbYes
emp = InputBox("Enter Employee#", "Employee Badges")
sEB = "SELECT * FROM [Employees] " _
& " WHERE [Emp#] = " & emp & ""
DoCmd.OpenReport "Employee Badges", acViewDesign
Reports![Employee Badges].RecordSource = sEB
DoCmd.Close acReport, "Employee Badges", acSaveYes
DoCmd.OpenReport "Employee Badges", acViewPreview
Case vbNo
sEB = "SELECT * from Employees"
DoCmd.OpenReport "Employee Badges", acViewDesign
Reports![Employee Badges].RecordSource = sEB
DoCmd.Close acReport, "Employee Badges", acSaveYes
DoCmd.OpenReport "Employee Badges", acViewPreview
End Select
End Sub
Like I said, if not possible then no worries... I'll just create a form to do this.