Displaying Records (1 Viewer)

Drunkenneo

Registered User.
Local time
Today, 15:38
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?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 03:08
Joined
Aug 30, 2003
Messages
36,134
I moved your thread to a more appropriate forum. Are you sure the bound column of the combo contains an Integer value?
 

Drunkenneo

Registered User.
Local time
Today, 15:38
Joined
Jun 4, 2013
Messages
192
Yes, Indeed
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 03:08
Joined
Aug 30, 2003
Messages
36,134
When the error occurs, go into debug and hover over the combo reference. What value does it contain?
 

John Big Booty

AWF VIP
Local time
Today, 20:08
Joined
Aug 29, 2005
Messages
8,262
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
 

Drunkenneo

Registered User.
Local time
Today, 15:38
Joined
Jun 4, 2013
Messages
192
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?
 

Drunkenneo

Registered User.
Local time
Today, 15:38
Joined
Jun 4, 2013
Messages
192
It is still exiting out because of null value input in the combobox
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 20:08
Joined
Jan 20, 2009
Messages
12,859
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

Top Bottom