And in the same form you want to display all 25 tables with the respectiv criterias...
So you need few things..
In your form have enough fields = max of fields of your tables... To be sure that it's ok create 255 fields...
Than when you want to visualise a table you need to access the tableDefs section and retrieve the information about the fields
Set all fields from the table to your fields in the form... /This is the control Source property
At the end generate your SQL as a filter... and your table in recordset property..
Your code seems very small to perform all this things... Consult TableDef property for more info..
:)
Quote:
Originally Posted by melaine
I have to work with an existing database with 25 tables.
I want the end User to be able to modify rows within the tables (add/amend/delete) via a Form. I do not want to create a query for the form, I want to dynamically create a query to access the table to then display the table within an editable form. Can this work? Anybody got any ideas of how I could do this?
I have tried the following syntax using VBA (access2000), but this does not work. I get no response! I am also confused with the building of my SQL string??? I am going mad here...
Any h elp will be much appreciated!
Thank you All!
~~~~~~~~~~~~~~~~~~~~~~
Dim strFormName As String
Dim strQueryName As String
Dim strSQL As String
Dim stLinkCriteria As String
strFormName = "FrmDelivery"
DoCmd.OpenForm strFormName, acNormal, , "SELECT * FROM " & cboAcctName " & "WHERE (((" & cboAcctName & ".Location)=""));", acFormEdit, acWindowNormal
~~~~~~~~~~~~~~~~~~~~~~