Move to a control based on value of field

A

ADavis

Hello,

I am creating a form to mimic a paper survey. There are times where a
person will answer NO to a question and that will require they move to a
different control on the form. (This form could be quite a way down the tab
order.) How do I move to another control that is not the next in the tab
order?

I assume I use the afterupdate property. I want to say somthing like:

if fruitveg1=1 then
gotocontrol fruitveg4
else
gotocontrol fruitveg1

Can someone help me?

Thanks,
Andy Davis
 
B

Brendan Reynolds

Very close! Either of these two methods will work. I've commented out the
first method using DoCmd so that I could test the second method, but left
them both in the code for illustration. "InvoiceDate" is just the name of a
control on my test form. Change it to the real name of your control.

Private Sub Command16_Click()

'DoCmd.GoToControl "InvoiceDate"
InvoiceDate.SetFocus

End Sub
 

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