*** Need urgent help

G

Guest

I have a form that accepts countrycode from pull down.

then I would like to pass this country code to a subform to

add records selectively from another group. This group consists of
different companies and I want to assodicate these companies
with the country.

I am able to pass on the the countrycode selected in main form to subform
using global variable. But it is not allowing me to store this country code in
the subform field. What I am doing wrong?

Main form field = country code

Subform fields are = country code,
company code,
contact code,

I am displaying company code and contact code from another table. Out of
which some records will be associated to the country code.

I would like to store the values of country code, company code and contact
code
in yet another table.

Thank you for your help!
-Me
 
J

Jeff Boyce

In Access, forms (and subforms) display data that "lives" in tables.
Everything starts with data in Access.

Without a more specific description of your data structure, specific
suggestions are hard to come up with.

If your data is well-normalized and your main form/subform design follows
common Access conventions, you shouldn't have to "pass" anything.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

Guest

Hi Jeff,

Thank you for your reply!

My tables don't exist in access, they are in sqlserver database.

2ndly, my database is normalized, however, I haven't created foreign
relationships between tables.

Or I am doing something wrong.

Here is the scenario -

I have a table with customer information

2nd table that has say event , customecode that joins with the customer table


I want to create a form where I should be able to choose the event on
top of the form and then
in subform be able to selectively add customers to this event.

How will you do it?

Thank you,
-Me
 
J

Jeff Boyce

Having data in SQL-Server is no guarantee of normalization.

If you are saying that you have events, customers, and
customers-who-particpate-in-events, then you need three tables for a well
normalized data structure.

I'm guessing that one customer can participate in many events, and one event
can be particpated in by many customers. This is a many-to-many
relationship and requires the third table to resolve this in a relational
database design.

If this were mine, I'd create a form which allowed me to pick (and edit)
events. I'd probably put a combo box in the header to pick an existing
event, then requery the form (based on a query that uses the combobox for a
selection criterion) in the combo box's AfterUpdate event.

I'd create a second form, based on the "customers-who-participate..." table
(actually, on a query against that table). I'd bind the value of the
customer field to a combobox on this form, to allow selection of a customer.

Then I'd "embed" the second form as a sub-form on the frmEvent, and have
Access handle coordinating between this main form and the sub-form.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top