By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,659 Members | 1,939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,659 IT Pros & Developers. It's quick & easy.

Converting query from Access to ADP

P: n/a
Hi all,

I've got this macro that I run to synch two forms. As part of that
synch, I have to set all instances belonging to the current customer
record in an associated table called tblDomains.

This was how I did it in Access/JET:
UPDATE tblDomains SET Primary = False WHERE CustomerID =
Forms!frmCustomers!CustomerID

Basically it checks the other form for which customer is currently
selected, and then set all records associated with that customer in
tblDomains to false.

Now in ADP, this is causing all kinds of problems. First of all, it
seems like SQL needs to get 1/0 instead of True/False. I think I
solved that, I changed it thus:

UPDATE tblDomains SET Primary = 0 WHERE CustomerID =
Forms!frmCustomers!CustomerID

Ok, now I get an error saying "Line 1: Incorrect syntax near !" and
then it points to the same query. Does ADP use a different syntax for
referencing objects?

Any insight would be greatly appreciated,
Thomas
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"17028" <17***@student.hhs.se> wrote in message
news:89**************************@posting.google.c om...
Hi all,

I've got this macro that I run to synch two forms. As part of that
synch, I have to set all instances belonging to the current customer
record in an associated table called tblDomains.

This was how I did it in Access/JET:
UPDATE tblDomains SET Primary = False WHERE CustomerID =
Forms!frmCustomers!CustomerID

Basically it checks the other form for which customer is currently
selected, and then set all records associated with that customer in
tblDomains to false.

Now in ADP, this is causing all kinds of problems. First of all, it
seems like SQL needs to get 1/0 instead of True/False. I think I
solved that, I changed it thus:

UPDATE tblDomains SET Primary = 0 WHERE CustomerID =
Forms!frmCustomers!CustomerID

Ok, now I get an error saying "Line 1: Incorrect syntax near !" and
then it points to the same query. Does ADP use a different syntax for
referencing objects?

Any insight would be greatly appreciated,
Thomas

You will not be able to write this:
Forms!frmCustomers!CustomerID

You need to get the value of CustomerID into the SQL statement before you
try to get it processed. Don't forget the different syntax, depending on
whether this ID is text or a number:

Number: ...WHERE CustomerID = 12569

Text: ...WHERE CustomerID = 'AB0218'

Can you convert your macro to VBA code or do you need some help?

Fletcher
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.