View Full Version : Same forms for different tables or not?????


paulmcdonnell
05-31-2001, 09:39 AM
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
05-31-2001, 01:08 PM
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
06-01-2001, 05:43 AM
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