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

Form to Update individual records, No Primary Key.

Status
Not open for further replies.

air0jmb

Technical User
Sep 8, 2006
38
US
I want to create a form for running an update query which gives the user the choice to update or not update the current record in frmA to the values of record in frmB. If frmB contains more than record (would most likely never be more than 2), the user can select the record to use for updating data in record in frmA.

Each day users download current data (Access table: tblExDwnld is linked to the .txt file), and append records to the main table: tblExHist. Only records with a date and time greater than what is already in tblExHist is appended.

Here's the key fields of the 2 tables:
tblExDwnld (linked to .txt file) - Fields: ExDate, ExTime, ExTail (aircraft ID number), ExGtwy (airport ID for problem location), ExDesc, ExActionTaken. No Unique Field provided in downloaded .txt file.

tblExHist - same fields, plus additional fields which capture analyst inputs like relevant history, problem classifications, etc.

The data (which is downloaded from another application) is subject to updates and/or deletions until the 10th day of the month, at which time the records become locked in stone. Analysts in my area need to be able to research and make reports which are accurate and up-to-date based on information in latest download. Since there is no primary key in our downloaded data, and no combination of fields which would ensure 100% uniqueness, I can't just update the whole table at once. So I want to be able to view records from tblExHist individually and compare them to records in tblExDwnld where fields ExTail, ExDate, and ExGtwy are the same for both.

frmA recordsource would be a query of tblExHist, filtered by a date range).

frmB recordsource would be a query of tblExDwnld, where records share same fields: ExTail, ExDate, and ExGtwy.

I'd like to be able to select a record in frmB and then push a command button that updates the current record in frmA.

I'm thinking something like the Windows msgbox that pops up when copying files that says something like "Windows found this existing file with same name, do you want to overwrite?" But instead of filename, use a combination of 3 fields.

Is there a simple way to accomplish this? Any help would be greatly appreciated!!!

Thanks!

Mike





 
How are ya air0jmb . . .

First and foremost . . . does table [blue]tblExHist[/blue] have a [blue]primarykey?[/blue]

Note: if you can't [blue]ping the record[/blue] in [blue]tblExHist[/blue] . . . [purple]forget it![/purple] . . .

Calvin.gif
See Ya! . . . . . .
 
Hey AceMan1!

tblExHist does have PK - ExID (autonumber).

air0jmb
 
Could you explain the importance of a Primary Key on the record we're updating (or how that field would be used), since the record we'd be using to update from does not have a Primary Key?

Wouldn't we be updating the current record (in frmA) with the selected record (in frmB). This seems like it should be fairly straight forward, but I'm really having trouble understanding how to set this up in a user-friendly manner.

Thanks for any assistance!!

Mike
 
air0jmb . . .

Hint:
Code:
[blue]Forms!frmAName!frmAFieldName = Forms!frmBName!frmBFieldName[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top