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

Create a dynamic data entry form 1

Status
Not open for further replies.

bigz60

Technical User
Apr 18, 2007
40
US
Hello.

I have a db that is being used to track telephone charges for my company. We have two separate phone service providers, and we receive two consolidated bills per month. Each bill has over 50 phone lines (phone numbers) associated with it.

I would like to set up a data entry form that has a combobox at the top where the user will select the provider's name, and then the form will be populated with the phone numbers associated with that service provider.

I am envisioning a form that has the phone numbers as data labels, and text boxes for the gross billed amount per phone line.

I am sure that this is possible, but am not sure where to begin.

I have already created all of the data tables necessarey, and I just need a way to create a data entry form that is relatively easy to use.

My table structure is as follows:
I have three tables:

1 - Providers, this table has two fields, providerID and providerName

2 - Lines, this table has three fields, lineID, lineNumber, and providerID

3 - Charges, this table has three fields, lineID, amount, and date.

I hope this all makes sense.

THank you in advance.
 
I am envisioning a form that has the phone numbers as data labels, and text boxes for the gross billed amount per phone line.

This is not a good idea. The normal way to do what you want is with a form and subform. The providers table will be the form and the subform will either be the lines table or a query based on the lines and charges table. Wizards will do most of the work for you. Have a look at the Northwind sample database that ships with every version of Access (you can also download Think of providers as either customers or orders and phone lines as either orders or order details.




 
I think I would use synchronized continous subforms, or synchronized listboxes and subforms. It does not sound like you change the providers, and phone line information often only the cost information. You could put three continous subforms on a main form. The first subform has the providers, the second has the phone lines, the third has the charges for a given line. If you synch the subforms you will click on a provider, the second subform would show only the lines for that provider. Then when you click on a line the 3rd sub would only show you the charges for that line.

This is how you do it.
1. Make two invisible textboxes on your main form: "txtBxProvider" and "txtBxLine".
2. In the on current event of you provider sub form add the code
txtBxProvider = me.providerID
3. in the on current event of your line subform add the code
txtBxLine = me.LineID
4. In the subform control of the Line subform
link Master fields: [txtBxProvider]
link child fields: [providerID]
5. In the subform control of the charges subform
link master fields: [txtBxLine]
link child fields: [lineID]

Voila. They are all synchronized.
 
The following should read

me.parent.txtBxProvider = me.providerID
3. in the on current event of your line subform add the code
me.parent.txtBxLine = me.LineID
 
That is a quick demo of synched subforms.
 
Thank you. I will try this out. It seems like exactly what I want to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top