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

Append Query

Status
Not open for further replies.

beckyr51

Programmer
Jan 29, 2008
36
IE
I have an append query that works well but i was wondering if it is possible to update another field in the table im appending to without that value coming from the other table i.e mark as past tutor when added to this table. My code is:

strsql = "Insert into [tblOther Staff]( OTH_FORENAME, OTH_SURNAME, OTH_DP_NO, OTH_FAC_NO, OTH_EMAIL)"
strsql = strsql & "Select tblTutor.TU_FORENAME, tblTutor.TU_SURNAME, tblTutor.TU_DP_NO, tblTutor.TU_FAC_NO, tblTutor.TU_EMAIL "
strsql = strsql & "From [tblOther Staff], [tblTutor]"
strsql = strsql & "Where tblTutor.[TU_CODE] = " & "'" & retiring & "'"
db.Execute (strsql)

and i want to make the OTH_PAST tick box be ticked when this query happens - hope this makes sense! Thanks
 
Yeah, no problem. Try:
Code:
strsql = "Insert into [tblOther Staff]( OTH_FORENAME, OTH_SURNAME, OTH_DP_NO, OTH_FAC_NO, OTH_EMAIL, [red]OTH_PAST[/red])"
strsql = strsql & "Select tblTutor.TU_FORENAME, tblTutor.TU_SURNAME, tblTutor.TU_DP_NO, tblTutor.TU_FAC_NO, tblTutor.TU_EMAIL, [red]True as PastVal[/red] "
strsql = strsql & "From [tblOther Staff], [tblTutor]"
strsql = strsql & "Where tblTutor.[TU_CODE] = " & "'" & retiring & "'"
db.Execute (strsql)
Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
You're welcome, glad I could help [smile]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top