I need to open a form to display a bmp picture. There are several different bmp so they are stored in a table. I have different forms where I want to pull the bmp's from so in order to make the query work I was going to use a couple of Variables in order to do this so that I would not need to create many different forms.
So what I have so far is
module
Option Compare Database
Public MyVariable1 As String
Public MyVariable2 As String
Now on a form I have a command button and in the onclick property I have
Private Sub form1_Click()
MyVariable1 = "value 1"
MyVariable2 = "value 2"
DoCmd.OpenForm "Frmtwo"
now on Frmtwo I have many more command buttons that a user can select which opens other forms and in the Record Source of these other forms I have it set to the query. So in the criteria field on the query I want to have = [MyVariable1] and =[MyVariable2] Now I know this won't work so I need to creat a function to set the variables and then a function to get the variables is this correct? Does anyone have any examples as to how to do this?
thanks for your time
jon
So what I have so far is
module
Option Compare Database
Public MyVariable1 As String
Public MyVariable2 As String
Now on a form I have a command button and in the onclick property I have
Private Sub form1_Click()
MyVariable1 = "value 1"
MyVariable2 = "value 2"
DoCmd.OpenForm "Frmtwo"
now on Frmtwo I have many more command buttons that a user can select which opens other forms and in the Record Source of these other forms I have it set to the query. So in the criteria field on the query I want to have = [MyVariable1] and =[MyVariable2] Now I know this won't work so I need to creat a function to set the variables and then a function to get the variables is this correct? Does anyone have any examples as to how to do this?
thanks for your time
jon