Validating/ routing entry data

roberttran52002

Registered User.
Local time
Today, 15:42
Joined
Aug 12, 2007
Messages
27
Dear experts,

I'm quite new to Access but find it very interesting to learn more. I used to create data entry in other softwares but now like to use Acesss instead since it has many advantages i.e can be used for web survey.

My question is how to create the routing/ jump & how to check the relationship across fields for the same record right from the entry (i.e Age=18 ---> jump to "smoking"; "drinking"=yes --> "Age">25)

Any advice is really appreciated.

Thank you so much,:)

Hop
 
Logic check on entry

So sorry for not being clear enough!

I want to check the relationship between fields/ variables for the same record right from the entry. The example as follows:

1/ If field "Age"=18 ---> jump to field "smoking" [skip any question in between];

2/ If filed "drinking"=yes --> field "Age" must >= 25 [any value <25 will not be allowed in field "Age".

Thank you so much & hope to get your guidance,

Hop
 
You are going to have to do this in VBA. You can use the LostFocus or After Update events of the fields to check when they have been filled in and then use the setfocus property to move to the required field.
 
Yeah, I would say that Rabbie is right...maybe something like...
Code:
Function()
  If (Forms![form name]!Age = "18") Then
    DoCmd.GoToControl "Smoking"
  End If
End Function
 
Big Thanks

Thanks a lot to Ajetrumpet & Rabbie!

It's a bit silly & troublesome to ask this but since I'm totally new to Access & hence don't know how to use the code Ajetrumpet recommended. I would be grateful if you could be show me a bit more specifically how to use it.

So indebted to all of you! :)
 
control = "Age" > properties > > "event" tab > click the "..." icon in the "OnLostFocus" line. Select "Code Builder", type the code in the module it provides. I suggest you buy a book on the program if you're unsure of how to do this. Navigating is half the battle in Access. :)
 
Fantastic

Dear Ajetrumpet,

It works like a charm! Thank you so much for your patience & kindness. I will definitely buy book and get to learn more about Access. It's really interesting.

Thanks once again,

TH
 

Users who are viewing this thread

Back
Top Bottom