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

Update help please

Status
Not open for further replies.

JMM

Technical User
Feb 17, 2000
37
NZ
I have a table that stores hearing aid service records. One aid may be serviced several times and then at some point it may be written off. I have a Y/N field of 'WriteOff'.
If the last service resulted in a 'WriteOff' then I want all previous entries for that particular aid to also have it's 'WriteOff' field to = Yes as well.
Any help appreciated.
 
I can see this being a call to a macro in the OnUpdate event that runs a query similar to this:
Code:
UPDATE mytable
SET writeoff = Y
WHERE serialno = Me!mytextbox;
Hope that helps...

Terry M. Hoey
th3856@txmail.sbc.com

Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?
 
probably use an update query which uses the
[Forms]![NameOfForm].[FormControl Name]
as the Criteria for the Field containing the Key Field
where FormControlName is the TextBox containing the Key Field,
and then for the WriteOff field use
= [Forms]![NameOfForm].[FormControl Name]
as the UpdateTo Value
Where the FormControlName is the name of the CheckBox.

Then in the AfterUpdate for the CheckBox, add code to open the query. This should also allow you to reset the value back to False if you make a mistake.

PaulF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top