Select input field based on dropdown box selection

TommyLee

New member
Local time
Today, 11:22
Joined
Nov 19, 2020
Messages
5
I would like to create a form with one of the fields a dropdown box. In it would be PAY and CHG. I also would have two other fields titles Payment and Charge. When I select PAY for the dropdown, I would like it to move to the Payment field for input or when I select CHG it would move to the Charge field for input. Is this possible?
I very new to Access and hope this is the place to ask this.
 
Code this in the Change event of dropdown:

Code:
if me.dropdownname.text="PAY" then
    me.payment.setfocus
elseif me.dropdownname.text="CHG" then
    me.charge.setfocus
end if
 
if me.dropdownname.text="PAY" then me.payment.setfocus elseif me.dropdownname.text="CHG" then me.charge.setfocus end if
It gave me an error "compile error: method or data member not found". Like I said I'm very new to access, sorry if this is a simple fix.
 
Make sure to use the real names of the textbox. May not be the same as your fields
 
It gave me an error "compile error: method or data member not found". Like I said I'm very new to access, sorry if this is a simple fix.
Post your code please?
 
I don't think you have the correct fields defined. You need an ammountDue, payment type code which I would populate with Cash, Visa, AmEX, etc, and a ChargeTo field which becomes required whenever the PaymentType (along with exp date and the CC code), is not cash.
 

Users who are viewing this thread

Back
Top Bottom