killerflappy
Registered User.
- Local time
- Today, 14:18
- Joined
- Aug 23, 2017
- Messages
- 50
Hi guys,
I’m struggling to put a access-query into VBA with the right syntax.
The query is working and gives the SQL:
UPDATE tblMutations, tblDeliveryDate SET tblMutations.DeliveryDate = DLookUp("DeliveryDate","tblDeliveryDate","Search=" & "'1'") WHERE (([tblMutations].[Customer] Is Null))
I played around with “, ‘, (), [] etc.
It’s setting the DeliveryDate in the tblMutations to de DeliveryDate that is set in the row where Search is 1. In the tblDeliveryDate I store the DeliveryDate that is set on a form to use all around my database. Search is a short text. I point to the search and get the DeliveryDate.
In another VBA sql-statement I can refer to the DeliveryDate with: [tblDeliveryDate].[DeliveryDate] WHERE (([tblDeliveryDate].[Search]='1'))
Maybe this isn’t the right way to store this important date to use all around the database. I came up with this solution, because I can’t store just the deliverydate in a table and refer to it in SQL-statements or Dlookup’s. Or is there another way?
I’m struggling to put a access-query into VBA with the right syntax.
The query is working and gives the SQL:
UPDATE tblMutations, tblDeliveryDate SET tblMutations.DeliveryDate = DLookUp("DeliveryDate","tblDeliveryDate","Search=" & "'1'") WHERE (([tblMutations].[Customer] Is Null))
I played around with “, ‘, (), [] etc.
It’s setting the DeliveryDate in the tblMutations to de DeliveryDate that is set in the row where Search is 1. In the tblDeliveryDate I store the DeliveryDate that is set on a form to use all around my database. Search is a short text. I point to the search and get the DeliveryDate.
In another VBA sql-statement I can refer to the DeliveryDate with: [tblDeliveryDate].[DeliveryDate] WHERE (([tblDeliveryDate].[Search]='1'))
Maybe this isn’t the right way to store this important date to use all around the database. I came up with this solution, because I can’t store just the deliverydate in a table and refer to it in SQL-statements or Dlookup’s. Or is there another way?