Same forms for different tables or not????? (1 Viewer)

paulmcdonnell

Ready to Help
Local time
Today, 12:40
Joined
Apr 11, 2001
Messages
167
I'm sure that you can use the same form for different tables or queries by using a command button to select the record source....
However I can't seem to get this right does anyone know how to do this - would be greatly appreciated


Thanks


Paul
 

Jack Cowley

Registered User.
Local time
Today, 12:40
Joined
Aug 7, 2000
Messages
2,639
Lots of ways to skin this cat but I can tell you that a button on the form with this code will change the record source for the form:

Me.RecordSource = "QueryName"
 

paulmcdonnell

Ready to Help
Local time
Today, 12:40
Joined
Apr 11, 2001
Messages
167
Hi Guys, (again)

Thanks to Jack Cowley for helping me with the last request but I still cant quite get the command button to translate the data source to the form.
I'm using this: Dim D As String
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Form-Unresolved-callbacks"
D = "todays callbacks"

DoCmd.OpenForm stDocName, , , stLinkCriteria

Then the Form ON Open event uses an If to check what D is, it then opens the datasource.

But an error message of 'D is not defined' pops up...Why doesn't this translate across the foms. Or am I going the wrong way about it completely.


Many Thanks guys
Paul
 

Users who are viewing this thread

Top Bottom