Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Practical Easy Example Of Passing Data Between Forms

Status
Not open for further replies.

BTurner0606

Programmer
Dec 21, 2000
4
US
I am new to Access programming and I am sure this is not very difficult, but I am having trouble understanding how to implement it. I need help with the coding needed on the Openform for form_Family and needed coding for form_Visit.

I am up against a deadline and any help would be greatly appreciated.

I have the following scenario:

tbl_Family
FamilyID Integer
MemberNumber Integer
FirstName Text
LastName Text
BirthDate Date
---------------------------------------
tbl_Visit_Data
FamilyID Integer
MemberNumber Integer
VisitDate Date
Address Text
Telephone Text
---------------------------------------
form_Family
TextBox FamilyID
TextBox MemberNumber
TextBox FirstName
TextBox LastName
TextBox Birthdate
CommandButton "Visit Info"
---------------------------------------
form_Visit
TextBox FamilyID
TextBox MemberNumber
TextBox FirstName
TextBox LastName
TextBox BirthDate
TextBox VisitDate
TextBox Address
TextBox Telephone
---------------------------------------

When I click the CommandButton on form_Family, I want to pass the FamilyID and MemberNumber to form_Visit. Then I want FirstName, LastName and BirthDate to be automatically populated with data from the tbl_Family. I will enter VisitDate, Address and Telephone to complete the data entry.


Bently Turner
bturner@wi.rr.com
 
When you're new, it's a little easier to answer your questions if you begin with a general statement of the operational results you're trying to achieve rather than getting straight to the details. The reason is that sometimes there is an easier approach than the one you are taking. In this case, I'd question your table structure before tackling the form. It sounds like the data in the Family table describes a Family Member, not an entire Family. If so, FamilyMember (or Person or whatever) is a better name than Family. Also, Address & Telephone sound like attributes of a FamilyMember (Person), rather than a Visit. If that is true, they should be fields in your FamilyMember table, not Visit, and all this changes your question.

To get a form like the one you're describing, you'd create a query with all the desired fields in it, create a new form based on that query, and use the Button Wizard to create a new button on the Family Member form that opens the new form. You don't need any code for any of this. Hope this helps :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top