Make table with dates chosen by the user
I have copied from a book a very nice looking form containing a calendar and 2 controls, named
txtBeginDate and txtEndDate. When i choose a date from the calendar, for example 06.02.2001, this date appears on the control,and then the same for the txtEnddate.
I have a maketable function and i want very much to tie up my function with the calendar,but i do not know why,if possible at all.
My maketable function is the folowing:
Dim strOrders As String
Dim strWhere As String
strWhere = ” WHERE ((([orders].[orderdate]) between >#1/1/2001# And #1/2/2001));” ‘ the setting is dd.M.yyyy
‘ ====================================
strOrders = ” SELECT orders.orderid, orders.customerid, orders.orderdate, orders.[required date], orders.SalesTaxRate, orders.freigth,
orders.paymentid, orders.PaymentMethodID, orders.bankid, orders.FreightCharge, orders.invoicedate, orders.AuftragNr INTO orders1
FROM orders”
CurrentDb.Execute strOrders & strWhere
End Function
My question is, can i pass the values chosen in the controls txtBeginDate and txtEndDate into my maketable function,
in order to obtain a new table based on the values i have chosen in the calendar form.If i succedd i could gain a big flexibility
for the user to choose dates.