If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
I want the initial Query to be from VBA Code
I am developing an access application, the first time a I load a form
data is retireved from the base query. I deally i would want to change this so that the form loads with and dispals data from VBA code (my query will be in VBA). How do I go about doing this? I have tried to pu the code on the on load and open form but it still doesnt work. Your help will be apprecited. Regards, |
#2
|
|||
|
|||
I want the initial Query to be from VBA Code
The following will work in the On Open event of a form:
Me.RecordSource = "Select * from [MyTable] where [MyTable].[LastName] = " & Chr(34) & "Smith" & Chr(34) You have not posted your code, so we cannot comment ... However, you might want to take the SQL portion of it and run it directly as a query (outside of the form) to see if it returns records. -- Cheryl Fischer, MVP Microsoft Access "Sam" wrote in message ... I am developing an access application, the first time a I load a form data is retireved from the base query. I deally i would want to change this so that the form loads with and dispals data from VBA code (my query will be in VBA). How do I go about doing this? I have tried to pu the code on the on load and open form but it still doesnt work. Your help will be apprecited. Regards, |
Thread Tools | |
Display Modes | |
|
|