Insert Into

rnutts

Registered User.
Local time
Today, 09:23
Joined
Jun 26, 2007
Messages
110
Hi

I wish to insert a date into a field SalesDate in table tblStockBook from a form frmSalesInvoice which is based upon another table tblSales. Could someone please help me with the WHERE part of the sql statement

InsertInto tblStockbook(SalesDate) Date() ("&StockNumber&")

Thanks

Richard
 
Hi

I wish to insert a date into a field SalesDate in table tblStockBook from a form frmSalesInvoice which is based upon another table tblSales. Could someone please help me with the WHERE part of the sql statement

InsertInto tblStockbook(SalesDate) Date() ("&StockNumber&")

Thanks

Richard

got the above line wrong
should be

InsertInto tblStockbook(SalesDate) Date() ("& me.salesdate&") where stocknumber = me.stocknumber

Stocknumber is a numeric field

Thanks

Richard
 
You might want to update date field

Update tblStockbook set SalesDate= #" & me!salesdate & "# where stocknumber = me.stocknumber
 
Mr. Nutts,

You might consider using the visual query tool to initially write the sql and then replace any hard-coded stuff in your query with the name of the control that contains the data for your where clause.

The reason I say this is that the portion of your query before the where clause will not work. You should get it syntactically correct before going on and the visual editor is the easiest way to do that. After that is correct, you can use the visual editor to set your where clause to a static value which you will eventually replace with your control's value.
 

Users who are viewing this thread

Back
Top Bottom