Thanks for reading this,
I have a command button on a continuous form(form 1) and I need this button to open another form(form 2) when I press on it. So far so good.
When I press the button, I need some VBA to open the form(form 2) , search for a particular table name based on the open form(form 1) current record and use that table name as the newly opened form (form 2) data source. I have ways to do most of those task but for one thing:
How do I make access search for a table name containing a particular string? Here's what I am working with:
I probably don't need to write it but, I'm not a programmer so I hope my explanation is clear enough.
Thank you very much, the satisfaction of writing some code and succede in acchieving the task is so rewarding, I love it!
I have a command button on a continuous form(form 1) and I need this button to open another form(form 2) when I press on it. So far so good.
When I press the button, I need some VBA to open the form(form 2) , search for a particular table name based on the open form(form 1) current record and use that table name as the newly opened form (form 2) data source. I have ways to do most of those task but for one thing:
How do I make access search for a table name containing a particular string? Here's what I am working with:
Code:
Private Sub Commande26_Click()
On Error GoTo Err_Commande26_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim stDataSource As String
stDocName = "frmSuiviLogger"
stDataSource = Me.[#série]
DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria
Forms!frmSuiviLogger.RecordSource = "SELECT MySysObjects.Name FROM MySysObjects WHERE MySysObjects.Name = " * " &stDataSource& " * ""
Exit_Commande26_Click:
Exit Sub
Err_Commande26_Click:
MsgBox Err.Description
Resume Exit_Commande26_Click
End Sub
Thank you very much, the satisfaction of writing some code and succede in acchieving the task is so rewarding, I love it!