PC Review


Reply
Thread Tools Rate Thread

Combo Result adds check mark in another DB?

 
 
Bill
Guest
Posts: n/a
 
      3rd Feb 2009
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

 
Reply With Quote
 
 
 
 
Clifford Bass
Guest
Posts: n/a
 
      4th Feb 2009
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

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      4th Feb 2009
<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



 
Reply With Quote
 
Bill
Guest
Posts: n/a
 
      4th Feb 2009
Excellent Thankyou Thankyou Thankyou to both.
Much appreciated

Best regards
Bill

"Douglas J. Steele" wrote:

> <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

>
>
>

 
Reply With Quote
 
Clifford Bass
Guest
Posts: n/a
 
      7th Feb 2009
Hi Bill,

You are welcome! Glad to help.

Clifford Bass

"Bill" wrote:

> Excellent Thankyou Thankyou Thankyou to both.
> Much appreciated
>
> Best regards
> Bill

 
Reply With Quote
 
Clifford Bass
Guest
Posts: n/a
 
      7th Feb 2009
Hi Bill,

You are welcome! Glad to help.

Clifford Bass

"Bill" wrote:

> Excellent Thankyou Thankyou Thankyou to both.
> Much appreciated
>
> Best regards
> Bill

 
Reply With Quote
 
Clifford Bass
Guest
Posts: n/a
 
      7th Feb 2009
Hi Bill,

You are welcome! Glad to help.

Clifford Bass

"Bill" wrote:

> Excellent Thankyou Thankyou Thankyou to both.
> Much appreciated
>
> Best regards
> Bill

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I add active tick mark/check mark boxes in excel? gerberelli Microsoft Excel Misc 2 3rd May 2008 05:16 PM
Convert COMBO BOX to CHECK MARK =?Utf-8?B?c21hZ3M=?= Microsoft Access Forms 14 30th Jan 2006 12:19 AM
COMBO BOX to CHECK MARK with multiple answers =?Utf-8?B?c21hZ3M=?= Microsoft Access Forms 1 29th Jan 2006 09:51 PM
Placing a check mark in a combo box Rashar Sharro via AccessMonster.com Microsoft Access Forms 1 27th Apr 2005 07:42 PM
Can I mark Appointments as completed (check mark, line through, et =?Utf-8?B?ZHJzaHJpbmt3cmFw?= Microsoft Outlook Calendar 1 6th Nov 2004 09:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:55 PM.