finding a record from the contents of a text box (1 Viewer)

John Thomson

New member
Local time
Today, 15:27
Joined
Sep 7, 2000
Messages
8
Please help

I am new to Access - the scenario
one table with two fields temp_ID temp_NA, temp_ID is primary key

One autocolumnar form frmtemp

one text box Text8 on this form

I want to enter a value for Temp_ID in this text box and have the record with that ID made current and hence displayed on the form

I have tried all sorts of criteria to no avail

grateful for any help

John Thomson
 

Jack Cowley

Registered User.
Local time
Today, 15:27
Joined
Aug 7, 2000
Messages
2,639
John -

Create a Combo box on the form using the Wizard. From the first screen in the Wizard select the third Radio button, "Find a record on my form....". In the next screen select Temp_ID. Finish the rest of the Wizard. Now you can start to type in the ID that you want in the Combo box and the Combo box will start a search or you can click the down arrow and scroll to the desired number. When you hit the Enter or Tab key to exit the Combo box the data that is related to the ID that you selected will be displayed.

Good Luck...

HTH,
Jack

[This message has been edited by Jack Cowley (edited 09-09-2000).]
 

John Thomson

New member
Local time
Today, 15:27
Joined
Sep 7, 2000
Messages
8
Jack -

Thank you, I am already using the technique you described, I did not explain my problem properly, however I think I have solved it.

I have two tables, a father and son table

The father table has two fields, father_ID and _name, the primary key is father_ID

The son table has three fields, father_ID, son_ID and _name, the primary key is father_ID + son_ID

I wish to update _name in the son table and copy this to the appropriate record in the father table,

I can now do this using recordsets, my problem was handling strings within strings in the WHERE criteria all those " ' and &.

Is there a slicker way?

Thanks again

John
 

John Thomson

New member
Local time
Today, 15:27
Joined
Sep 7, 2000
Messages
8
Hi Richie

Yes the relationship is one to many

Say the father's IDs are F01, F02 F03 etc

The child table would have IDs such as

F01C01, F01C02, F01C03, F02C01, F03C01

Thanks for your interest
 
R

Richie

Guest
No doubt I will be corrected but I would have thought you only need the son as the primary key in the second table since the father key already exists you don't have to update the first table when adding sons to an existing father.
 

John Thomson

New member
Local time
Today, 15:27
Joined
Sep 7, 2000
Messages
8
Richie

The son ID could not be the primary key, there will be many C01 in the chid table. I know I could have created a unique key in the son table and stored the fther unique key as a foreign key in the child table,

The problem is compounded in that I have a grandfather table as well.

I do have to update the father's table as well, the fathers status , _name, is the chronologically last entered status of the son.

As I said, I think I have solved it but many thanks

John
 

Users who are viewing this thread

Top Bottom