Hi this should be simple -
I just need to refer to a variable in an SQL string in my VB code.
The string is -
rstUpdate.Open "SELECT * FROM [Customer Orders] WHERE [Cancel Booking] = False AND [Date Ordered] > #08-20-02# AND [Tour Date] > #" & Format(Date, "dd-mm-yy") &...
Thanks, indeed looks like the reason I am having problems -
I am not sure exactly why the array is null because it is supposed to be full, but I will attempt to get to the bottom of it - time to do some debugging.
If I am still having problems after looking into the code you may well hear...
Ok,
River Guy, it is not all on one line - thought I would put it into one line in my example on this thread to get rid of some of the quotation marks and '&'s.
So in my code it looks like -
Forms![Bookings]![Bookings - Subform 1]![Start Time].RowSource = "SELECT [Start Time] FROM...
Can anyone point me to some kind of reference which points out the ground rules for the SQL syntax in an SQL string in Visual basic. It obviously differs from that you see in the SQL view of a standard Access Query grid.
The Access help function only has limited examples it would seem. My...
got it...
don't know if this is the best way, but created an extra hidden field on form and formatted the date as mm/dd/yy.
Then just referred to this field, FormatDate in the SQL string.
seems a bit silly to have to do this, but it works so who cares.
I reckon there should be some way to...
Well, I still can't get any records with the expression typed as you suggested.
If I put a date directly into the expression
eg WHERE Date = #29/07/02# it still returns no records.
If however I enter the date literal in US format
eg WHERE Date = #07/29/02# it does return records.
My problem...
Hi,
does anyone know the correct syntax in an SQL string as part of the Recordset Open method to refer to a field on a form.
I currently have -
rstBookingsSchema.Open "SELECT * FROM BookingsSchema WHERE Date = " & Forms!BookingForm!Date & " ORDER BY Period", conn, 1...
Thanks,have managed to select my records now.
one thing though, I have had to use the open method to create the recordset as follows
Set conn = CurrentProject.Connection
Set rstBookingsSchema = New ADODB.Recordset
rstBookingsSchema.CursorType = adOpenDynamic...
Thanks for that.
Well I have entered that code, of course tailored to my situation as follows -
Dim conn As Connection
Dim rstBookingsSchema As Recordset
Set conn = CurrentProject.Connection
Set rstBookingsSchema = _
conn.Execute("SELECT * FROM BookingsSchema")...
First up I am a VB rookie.
I am writing a VB module which edits a group of records in a table based on some information entered on a form. I need to write a module as the manipulation/editing of the records is slightly complex.
My (simple) question is -
I need to select a group of records...
I wish I could but, I need to have the data displayed in a graphical format so that the data is user friendly, ie the users of the system can see all of the time intervals in a 24 hour period and the employee number at each time interval (between the Time Out and Time In values for the give...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.