|
-
October 19th, 2001, 08:23 AM
#1
selection code
This should be simple but for some reason I just can't get it! Here goes... I have an access form with an unbound text box an unbound combobox which filter and retreive information. What I need to do is put an error check in to make sure that if the user enters a number larger than 202 in the text box that they have also made a selection from the combobox which is between rows 9 - 14 in Column(1). For example,
If txtoitemID.value > 202 then
cboLabourType.column(1)= "Assembly" or "Spraying" or "Shipping" or "Packaging" or "Metal" or "Milling"
else Msgbox "Your order item number must be greater than 202"
end if
Assembly is in row 9 and Milling is in row 14 of the column.
I know this code is not right however, I hope it will give you a general idea of what I am trying to do.
Liza
-
October 19th, 2001, 03:02 PM
#2
Re: selection code
if cboLabourType.listindex >= 9 or cboLabourType.listindex <=14 then
if val(txtoitemID.text) <= 202 then
Msgbox "Your order item number must be greater than 202"
else
'Run code for item9-14 ordernumber ok
endif
'Run code for listbox items not 9-14
endif
This was written for vb, not vba, you may have to tweak
it for access vb, but the logic and basic structure
should be the same.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|