help with combo boxes and null

skate

Registered User.
Local time
Today, 16:44
Joined
May 22, 2002
Messages
136
I have a few combo boxes in which the user makes selections and thoses values are taken and displayed in textbox for viewing. But when there are no values selected in the combo boxes, my fcn for the display goes weird and says invald use of null. I tried If Isnull (L) then
L=""
end if

But it doesn't work. Why doesn't it accept blank entries in the combobox?
 
Try using the Nz Function, eg in your function when referring to 'L' use Nz(L) . This should convery any Nulls into a "" If not, Try Nz(L),"")
Another way is filtering for Nulls and then skipping that part of the function with If IsNull(L) =True then.....

If no joy, post your function code.
 
here's my code

Here's a bit of my function. It takes a selected line order from another form and based on that, displays the L, S, F & M values a certain way. Theses values are changed thru the combobox selection in the main form. The display textbox calls this function below. I don't see how using Nz() will help b/c doesn't it do the same as null?

Public Sub LineSort(Display As Object, L As String, F As String, S As String, M As String)

If IsOpen("Line Order") Then

If IsNull(L) then
L=""
endif

If (Forms![Line Order].LVal = 1 And Forms![Line Order].SVal = 2 And Forms![Line Order].FVal = 3 And Forms![Line Order].MVal = 4) Then
'line, size, fluid, mat'l
Display = L & "-" & S & "-" & F & "-" & M
Esleif.....
....
End Sub
 

Users who are viewing this thread

Back
Top Bottom