The same forms with different data 2 - almost there...

paulmcdonnell

Ready to Help
Local time
Today, 14:47
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
 
when you dimesion D in the form, you are making it a private variable which can only be used for the procedure it is dimensioned in. Take out your Dim D statement, and create a module and use:
Public D as string

This will give any procedure access to the variable.
 
Chrityg - Thanks alot

Hope I can recipricate in the future...
 

Users who are viewing this thread

Back
Top Bottom