I'm having a bit of trouble with the query.
So the main problem is that there are copies of the exact same button, one on a form and two on reports. This is what I have so far, but nothing is being returned:
Code:
SELECT Right([RetailNum],4) AS Retail, [tblOrderDetails].ConfNum
FROM [tblOrderDetails]
WHERE ((([tblOrderDetails].ConfNum)=GetValue()));
The Get Value which I use throughout the database function is as follows:
Code:
Public Function GetValue()
If CurrentProject.AllForms("frmOrderConf").IsLoaded = True Then
GetValue = Forms![frmOrderConf]![ConfNum]
ElseIf CurrentProject.AllForms("frmOrderList").IsLoaded = True Then
GetValue = Forms![frmOrderList]![ConfNum]
ElseIf CurrentProject.AllReports("rptSampleOrderConf").IsLoaded = True Then
GetValue = Reports![rptSampleOrderConf]![ConfNum]
ElseIf CurrentProject.AllReports("rptOrderConfPS1").IsLoaded = True Then
GetValue = Reports![rptOrderConfPS1]![ConfNum]
Else
GetValue = InputBox("Enter Confirmation Number")
End If
End Function
The button is currently on "rptOrderConfPS1", "rptSampleOrderConf", and "frmOrderConf". I'm testing it out with "rptOrderConfPS1" and the list comes up empty even though there should be a list of 15 or so.