Lookup value and control depends on lookup result

A

aw

I have 1 qry & 1 form.

Query named : QRY_bl_SalesInvoice

BL no. Sales Invoice
BL001 IV509999
BL002 (blank)
BL003 IV507777


Under the FORM, drop-down box named “dropdownBL†is used by user to select
BL no. under the qry on (a).

Questions :

How I set the following controls,

Case 1 : If BL no. under the drop-down box “dropdownBL†after select =
BL002 (with Sales Invoice=blank under the QRY) , then free to input on the
field named “Sales Invoice"

Case 2 : If BL no. under the drop-down box “dropdownBL†after select =
BL001 (with Sales Invoice<>blank) , then the field named “Sales Invoice" will
lookup related qry’s IV value, i.e. “IV509999†as its value

Also how we PREVENT user to amend the content that call from QRY in case 2?
 
A

Amy E. Baggott

If I'm reading your question correctly, then your best bet would be to put
something like the following in the After Update event of dropdownBL:

If IsNull(Me.dropdownBL.column(1)) Then
Me.SalesInvoice.Locked = False
Else
Me.SalesInvoice = Me.dropdownBL.column(1)
Me.SalesInvoice.Locked = True
End If

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top