Select input field based on dropdown box selection (1 Viewer)

TommyLee

New member
Local time
Yesterday, 18:00
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.
 

Isaac

Lifelong Learner
Local time
Yesterday, 16:00
Joined
Mar 14, 2017
Messages
8,887
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
 

TommyLee

New member
Local time
Yesterday, 18:00
Joined
Nov 19, 2020
Messages
5
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.
 

MajP

You've got your good things, and you've got mine.
Local time
Yesterday, 19:00
Joined
May 21, 2018
Messages
8,605
Make sure to use the real names of the textbox. May not be the same as your fields
 

Isaac

Lifelong Learner
Local time
Yesterday, 16:00
Joined
Mar 14, 2017
Messages
8,887
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?
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 19:00
Joined
Feb 19, 2002
Messages
43,489
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.
 

Isaac

Lifelong Learner
Local time
Yesterday, 16:00
Joined
Mar 14, 2017
Messages
8,887
Glad you got it working! (y)
 

Users who are viewing this thread

Top Bottom