If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
form
I have 30 sections in my office, i have a database with a form for
each section. How do i create a form that will let them choose their section from a pull down and open their form based on their section selection. |
#2
|
|||
|
|||
form
wrote in message
ups.com... I have 30 sections in my office, i have a database with a form for each section. How do i create a form that will let them choose their section from a pull down and open their form based on their section selection. You could use a combobox with each section listed, then use the AfterUpdate event to open the form based on the user's choice. For example, set the combo's RowSourceType to Value List, then add this in the RowSource: Section 1;Section 2;Section 3 etc etc Then, in the AfterUpdate event of the combo (I'll name the combo cboChooseSection): Sub cboChooseSection_AfterUpdate() Select Case me.cboChooseSection.Column(0) Case "Section 1" DoCmd.OpenForm "fmSection1" Case "Section 2" Docmd.OpenForm "frmSection2" Case Else End Select End Sub Of course, you'll need to change the names of the forms and such to match those in your project. |
#3
|
|||
|
|||
form
Consider putting all your data in two tables:
TblSection SectionID SectionName TblMyData MyDataID SectionID Fields for all your data Next you need a query that includes both fields with the following criteria for SectionID: Forms!PFrmSelectSection!SectionID You then need a form, FrmSectionData, based on the query. Next to last you need a pop-up form named PFrmSelectSection with a combobox named SectionID. The rowsource of the combobox needs to be the following SQL: Select SectionID, SectionName From TblSection OrderBy SectionName The properties of the combobox need to be: BoundColumn 1 Column Count 2 Column Width 0;2 In the AfterUpdate event of the combobox you need the following code: Me.Visible = False Lastly, you need the following code to open PFrmSelectSection: DoCmd.OpenForm "PFrmSelectSection",,,,,acDialog DoCmd.OpenForm "FrmSectionData" Docmd.Close "PFrmSelectSection" PC Datasheet Providing Customers A Resource For Help With Access, Excel And Word Applications wrote in message ups.com... I have 30 sections in my office, i have a database with a form for each section. How do i create a form that will let them choose their section from a pull down and open their form based on their section selection. |
Thread Tools | |
Display Modes | |
|
|