Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

access training course - subforms

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » access training course - Subforms

access training course - Subforms

ResolvedVersion Standard

Jenny has attended:
Access Intermediate course
Access Advanced course
Access VBA course

Subforms

I have a main form (customer) which has a sub form (PetSubform). A customer can have one or more pets and the PetId, pet name and breed is shown in the subform.

I would like to double click on a row in the subform and open a form which shows all the fields related to that pet.

I can double click and get a form to open, but i need the form to open and display the right info based on the PetID.

Is there a way to select the PetId in just the selected row in the sub report and then open the form based on the petid in the selected sub report row.

RE: Subforms

I suggest that you use a command button to activate the form. When you draw a command button on the PETSubform, follow the wizard to:

1. Open the pet form
2. Select the value you want
3. Link the fields together

Once this is done, you can see the code behind the button, on the CLICK Event.

I would suggest that rather than using a DATASHEET view, use a CONTINOUS FORM VIEW, and have a button appear next to each record.
Arrange the fields to that it looks like a datasheet.

This will get you started in the right direction.

Let me know how you do.

Richard

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Access tip:

Choosing data types in Access

Not sure which data type to use for your Access fields? Here are some guidelines to help you choose a data type to assign to a field.

- The Text data type can accept up to 255 characters. For information that will be recorded in paragraphs, use Memo.

- Also use Text for numbers that aren't going to be used in calculations, e.g. phone numbers.

- Use the Currency data type for monetary amounts.

- Use Date/Time for dates.

- Most other numbers can use the Number data type, but the Field Size property may have to be altered.

- For fields that have only two alternatives (yes, no) use Yes/No data type. If there is likely to be a third entry option (e.g. maybe or don't know) use Text instead.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.11 secs.