Displaying Records

Drunkenneo

Registered User.
Local time
Tomorrow, 00:40
Joined
Jun 4, 2013
Messages
192
Private Sub Find_Click()
'DISPLAYING RECORDS FROM MASTER DATEWISE
Dim Order_combo47 As Integer
Dim rs As dao.Recordset


Order_combo47 = Combo47.Value

'On Error GoTo Err_find_Click
Combo47.SetFocus
MsgBox Order_combo47
Me.Report.RecordSource = "select * from Orders_Processed where order_number =" & Order_combo47 & ""

End Sub

Not working and getting highlight on "Order_combo47 = Combo47.Value" why?
 
I moved your thread to a more appropriate forum. Are you sure the bound column of the combo contains an Integer value?
 
Yes, Indeed
 
When the error occurs, go into debug and hover over the combo reference. What value does it contain?
 
combo47.value=null
That would tend to indicate that a selection has not yet been made in the combo47.

Try;
Code:
Private Sub Find_Click()
'DISPLAYING RECORDS FROM MASTER DATEWISE
Dim Order_combo47 As Integer
Dim rs As dao.Recordset

[COLOR="SeaGreen"]'Test for selection in combo and stop if no selection made[/COLOR]
If IsNull(Me.Combo47) then
     MsgBox "Please make a selection from the list"
     Me.Combo47.SetFocus
     Me.Combo47.Dropdown
     Exit Sub
End If

Order_combo47 = Combo47.Value

'On Error GoTo Err_find_Click
Combo47.SetFocus
MsgBox Order_combo47
Me.Report.RecordSource = "select * from Orders_Processed where order_number =" & Order_combo47 & ""

End Sub
 
I have applied this code, but still in testing it gives the same value=null in spite of inputing the correct value, what is the possible reason for this error?
 
It is still exiting out because of null value input in the combobox
 
Either you have the combo set up wrong with a Null being returned for the BoundColumn or there is someting corrupted in the combo.
 

Users who are viewing this thread

Back
Top Bottom