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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help creating an addnew subform

Status
Not open for further replies.

TiggerDaKat

IS-IT--Management
Jan 29, 2003
55
US
I want to be able to make a new entry in my ServiceDetails Table from a form linked to the main service table.
When I click the button, I'd like the ServiceDetails subform to appear with the ServiceID field already filled in, linking the records. However I can't figure out how to fill in the field automatically. Any help would be greatly appreciated.

Thanks,

Eric
 
I need to combine 3 forms to make a multipart form with tab controls. Can that be done? If so how? cjgrower
 
TiggerDaKat,

From the context of your post, I assume that your ServiceDetails subform is not visible by default, so create an event procedure in the On Click event of your command button and put in code like this:

Code:
Me!SubFormName.Visible = True
Me!SubFormName.Form!ServiceID = Me!ServiceID

...where SubFormName is the name of the subform control on your main form (NOT necessarily the same as the name of your subform!)

HTH...

Ken S.
 
cjgrower,

Yes, this should be pretty easy, depending on the complexity of your original forms and the amount of code you will be transferring. (famous last words!) ;-)

1) Create a new form in design view.
2) Place a tab control on the form. By default it will start with 2 tabs. If you need more, right-click on the tab control and select "Insert Tab".
3) Open the first form that you want to put on the tabbed form. Select all the controls on the form, then Ctrl-C to copy to the clipboard.
4) Select the tab on your first form where you want these controls to appear. **IMPORTANT** Make sure you select the tab page, NOT the form or form detail section, or the controls will be pasted to the underlying form, not into the tab control. Hit Ctrl-V to paste.
5) Repeat for the other forms and tabs.
6) This may be the tricky part: any code you have behind the other forms must be moved to the new form, and edited to make it conform to the new form.
7) Another gotcha - if you have field names that are the same on more than one of your original forms, when you paste the controls Access will automatically assign them default names to prevent having duplicate field names on the same form. So you may need to re-enter your field names after pasting.

HTH...

Ken S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top