Posting again my problem for help

JIT

Registered User.
Local time
Today, 05:13
Joined
Sep 11, 2002
Messages
29
I am again positng my problem, so that some of you can help me.

I have two tables. Table 1 has following fields: Test (primary key), TestRequirement, TestFrequency, TestOrganization. There is a associated form, Form 1

Table 2, specific record for particular test, has following fields, Test, Test Requirement, DateOfTest, PersonDone, Results, Comments. There is a associated form, Form 2

Table 1 has 1 to many relationship with Table 2. I have added a command button in form 1. I first open form 1 to see a particular test type, say Voltage test. When I click the command button, I navigate to form 2, which is specific about a particular test, say Voltage test, and the common field such as Test Type, here Voltage, Test Requirement should automatically be filled up from Table 1. But this is not happening. What I did in Form 2, for example, in 'Test' text box I have added, =[Test]![Table1]. However, when I open the Form 2 from Form 1, the 'Test' field shows #NAME?. I do not know what to do. I would appreciate any help very much to sort out the issue.

Once again thanks in advance,
 
subform?

Have you considered doing this with a subform? That way you could just navigate thru your test records, and would automatically see all the related details for each one, without having to click any command buttons.

To do this [test with copies first], put the main form in design view. Then drag and drop the second form onto the first. Then link the master/child fields on the data tab of the form properties.

I assume that the field 'Test' is the primary key in the main form and the foreign key in the second form.
 
Thanks for your prompt reply. I have not tried with subform. I will try that. Am I able to enter data in the subform? Is there also any way out for my original idea?
 
I'm happy to see this post because...

Thats the exact situation (or close enough to it) that I have been working like mad to figure out over the last couple days but wasn't asking the question correctly :D I figured subforms or tabs got me closer to the answer but in the end, I still have questions. I resorted to a 2 table setup to test my situation to make it as simple as possible and realized either "thats the way it is and thats the way its gonna be" or, " I need to learn how to ask questions better" :) When I add a 2nd table as a subform, I can enter data into my main form and also my subform but I have 2 navigation controls. So when I enter the 1st (of possible many records but only one per any 1 day), and am at the end of the 2nd tables (the subform) fields, it starts the next record number in that tables recordset. I want it to go back to the 1st field in the main tables recordset. And I know I can with the mouse, but it seems like I should be able to do this with code or something. If not, when the user of this database has to enter all the original records into the 2 tables on a form with a subform, it seems like its not as user friendly as it should be...
Comments welcome,
sorebrain

Access 2000
learning as fast as I can :eek:
 
Last edited:
Sore,

Use the OnExit event of the last control of your subform:

Forms![YourMainForm].Setfocus

or

Forms![YourMainForm]![SomeField].Setfocus

Wayne
 
That sounds like the answer

Wayne, Thanks for the prompt response. That sounds like what I was looking for. This will make my day :cool:
sorebrain
 
Would anybody answer my questions

Sorebrain, you got your answer. Would you or anybody please give me a clue how to solve mine, without the use of subform. I would very much appreciate anybody's help.

Jit
 
oops

Sorry JIT, I didn't mean to jump in like that....
 
Last edited:
JIT this may help...

I googled and found this just to try to help even though I am just learning...

<snip>
Are you sure you are getting the #Name? error ????

This indicates that Access can not find a reference to an object .. such as a field in the recordset.
Not that it does not contain a value as you have indicated ...

<snip>

sorebrain
 
JIT,

Sorry that you got overlooked in this.

On form 2, set the field's DefaultValue to:

=Forms![YourMainForm]![TheKeyField]

Change names to suit your app.

Also, YourMainForm must be open at the time.

hth,
Wayne
 
Thanks WayneRyan, it has been done! You have suggested so simple solution. Till now, I have been directed round and round.

A Great relief!

Jit
 

Users who are viewing this thread

Back
Top Bottom