form validating input

CrazyKillerMan

Registered User.
Local time
Today, 14:19
Joined
Nov 26, 2002
Messages
23
Hello - this is my first post. I have browsed through most of the form section with no real solutions to my problem.

The problem being:
I would like a field entered via a form on table_a validated by the same field on table_b.
ie: Employee List table's Last Name field validates the last name entry in the last name field on table_a from form_x.

Is there any way to do this???

Also ... I am a little confused on the expression stuffs. Can I take and input from a form ... say the number 80 and fill other fields in that table with a mathmatical operation on it???

Sorry to have two questions in one, but I think I'm making the last problem I have harder than it is.

Thanks
Ben
 
I'll make a stab at some answers.

First, aside from browsing, I've found that the search functions for this forum are incredibly helpful, if you can find the right words to search for. Often I find several posts which are circling the question I have, if not outright answering them.

As for the table_a / table_b thing, it sounds like you want to enter the same data into both tables, and want to make sure that they match. I would instead use a combo box on the form, which if populated by the Employee List Table, and the user could simply choose a last name from the list. It's possible to have users enter the entire name, then search through the other table for that name and create a lot of error-checking code, but the combo box is much quicker.

And finally; yes, you can make a form fill in a table with calculated values from user input. One way is to create a form which uses the particular table for it's record source. Create an unbound textbox (i.e. txtInput), and textboxes bound to the fields (i.e. Field1 and Field2) from your table. In the OnExit event for txtInput, you could add a little bit of code which would do the desired calculation:
Code:
Private Sub txtInput_Exit(Cancel As Integer)
    
Me.[Field1] = [txtInput] * 48.1     'Your calc'tn on this side of =
Me.[Field2] = [txtInput] / 17       'Your calc'tn on this side of =

End Sub

You'll want to get some error-checking stuff into there as well to deal with crazy wild-assed user input.
 
Last edited:
Excellent - this was the answer I was looking for as I am a newbie as far as access is concerned.

Now - I agree with you on the combo box idea...but how does one populate that list with results of a query or a field in a particular table? Where is the option? Or am blind?

How do I bind a text box to a field???

Sorry if these are rudimentry questions ... but I am a newbie!

:D

Thanks

Ben
 
Ok - I figured out how to populate the list and its easy as pie.

Thanks for the help!
 

Users who are viewing this thread

Back
Top Bottom