<picky>
It's easier to use the Execute method:
CurrentDb.Execute _
"update OrderNumbers " & _
"set NAF = True " & _
"where PurchaseOrderNumber = " & OrderRef.Column(0), _
dbFailOnError
It saves having to set the warnings off and back on, plus it'll cause a
trappable error to be raised if something goes wrong with the query.
</picky>
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Clifford Bass" <(E-Mail Removed)> wrote in message
news:ADF791FC-E277-4CB3-A28C-(E-Mail Removed)...
> Hi Bill,
>
> You could use the RunSQL method:
>
> DoCmd.SetWarnings False
> DoCmd.RunSQL _
> "update OrderNumbers " & _
> "set NAF = True " & _
> "where PurchaseOrderNumber = " & OrderRef.Column(0)
> DoCmdSetWarnings True
>
> Clifford Bass
>
> "Bill" wrote:
>
>> Hi,
>>
>> On a form is a combobox which selects a Purchase order number.
>>
>> The Purchase order Number database is linked to the new Database where
>> the
>> form is stored.
>>
>> Upon selecting the number in Column 0 - say 12345 - in the after update
>> I
>> wish the corresponding table in the Purchase Order Database to have a
>> check
>> (Tick) added in the control called 'NAF" in the row corresponding to the
>> PO
>> number 12345.
>>
>> So far this is all my brain will allow me to think
>>
>> Private Sub OrderRef_AfterUpdate()
>>
>>
>> Dim strFilter As String
>> 'Evaluate filter before it is passed to Dlookup function
>> strFilter = "[OrderNumbers]= " & [OrderRef].Column(0)
>> 'Update PO Table NAF control based on PO value selected in the combo box
>> Nz (DLookup("[NAF]", "[OrderNumbers]", strFilter))
>>
>> rem OrdeNumbers.NAF = true
>>
>> End Sub
>>
>>
>> How do I link the dlookup which finds the correct row and then check the
>> control - make it true?
>>
>> Thanks in advance