LOUISBUHAGIAR54
Registered User.
- Local time
- Yesterday, 22:10
- Joined
- Mar 14, 2010
- Messages
- 157
Good day access programmers,
Greetings from Malta.
I wonder if I can please get some help.
I have a form "Appointments" which has a combo box, two list boxes and various other controls. List 54 updates on the 'after update' event of the combo box using code. This is working well
A value on List 54 is referenced from a textbox (Text62) on the form as follows;
=[Forms]![Appointments]![List54].[Column](1).
I had to do this indirectly as the SQL statement using the above statement directly did not work.
List 56 is the second list box. It updates on the 'after update' event of List 54 using VBA code which injects an SQL statement into the rowsource property of list 56.
Another textbox control (Text34) contains a date entry which is entered by the user, while (Text64) is another textbox entering time. Both are formatted as Date/Time entries.
I have added a command button which on click should generate code which among other things injects the following SQL statement so that list56 will update depending the date entry in Text34. I want the rows of the list sorted out according to date and time in that order.
The following is the SQL statement which is injected;
SELECT Query3.Appl, Query3.clName, Query3.Surname, Query3.cltIdcard, Query3.meta, Query3.hin, Query3.cltTel1, Query3.ID, Query3.confirm
FROM Query3
WHERE (((Query3.meta)=[Forms]![Appointments]![Text34]) AND ((Query3.dctidcard)=[Forms]![Appointments]![Text62]))
ORDER BY Query3.meta, Query3.hin;
For clarity sake 'meta' is the date field and 'hin' is the time field in a table.
This SQL statement is not updating the list when the command button is clicked. I suspect that it has to do with how I am writing the SQL statement as it should include something like # # for the date criteria and probably also for the time criteria.
Can someone please enlighten me on this problem ?
LouisB
Greetings from Malta.
I wonder if I can please get some help.
I have a form "Appointments" which has a combo box, two list boxes and various other controls. List 54 updates on the 'after update' event of the combo box using code. This is working well
A value on List 54 is referenced from a textbox (Text62) on the form as follows;
=[Forms]![Appointments]![List54].[Column](1).
I had to do this indirectly as the SQL statement using the above statement directly did not work.
List 56 is the second list box. It updates on the 'after update' event of List 54 using VBA code which injects an SQL statement into the rowsource property of list 56.
Another textbox control (Text34) contains a date entry which is entered by the user, while (Text64) is another textbox entering time. Both are formatted as Date/Time entries.
I have added a command button which on click should generate code which among other things injects the following SQL statement so that list56 will update depending the date entry in Text34. I want the rows of the list sorted out according to date and time in that order.
The following is the SQL statement which is injected;
SELECT Query3.Appl, Query3.clName, Query3.Surname, Query3.cltIdcard, Query3.meta, Query3.hin, Query3.cltTel1, Query3.ID, Query3.confirm
FROM Query3
WHERE (((Query3.meta)=[Forms]![Appointments]![Text34]) AND ((Query3.dctidcard)=[Forms]![Appointments]![Text62]))
ORDER BY Query3.meta, Query3.hin;
For clarity sake 'meta' is the date field and 'hin' is the time field in a table.
This SQL statement is not updating the list when the command button is clicked. I suspect that it has to do with how I am writing the SQL statement as it should include something like # # for the date criteria and probably also for the time criteria.
Can someone please enlighten me on this problem ?
LouisB