Linking forms

Locopete99

Registered User.
Local time
Today, 13:33
Joined
Jul 11, 2016
Messages
163
Hi Guys,

I have a long table that I want to split into multiple forms.

The first form will be my register form.

I then want to make smaller amendment forms.

The thing is though, I want to make a click button that opens the form, but as the two forms are on the same table, I want the Amendment form to open up on the same record as the register form.

Having not played around with subforms before, is this the way to go or is there another way??
 
The method used to open a form is
Code:
OpenForm(FormName, View, FilterName, WhereCondition, DataMode, WindowMode, OpenArgs)
FormName is required, the rest are optional. The parameter you want to make use of is WhereCondition. You pass the record ID of the current form to the new form eg
Code:
Docmd.OpenForm FormName,,,"ID=" & me.ID
The simplest way to 'learn' this is to create a command button on your form and allow the wizard to take you through the process. Then look at the macro or VBA code it creates in the OnClick event. You can either keep the command button or replicate the code for use with OnClick of the Form or an object/field in the record (the record ID?)

Incidentally, it is normal to have more than 1 form for a table. You may have a list view, data entry form and/or edit form. A subform is a form ON another form which probably does not apply here, as you will have a list.
 
Thanks Thats what I was after!
 

Users who are viewing this thread

Back
Top Bottom