AKK
07-06-2009, 12:53 PM
I have done a good bit of VBA in Excel, but I'm now using it with Access for the first time, and it looks like some of the syntax & names for things is a bit different. I know this must be pretty basic, but I've searched and searched and can't find the answer anywhere.
I've defined a variable called sProject (it's a string), and the first thing my code does is call up a user form with a combo box. The user then picks a project from the drop-down list. I want to tell Access to make their choice the value for the variable sProject. ie, if I were working in Excel, I think I'd write it something like...
Sub CallEmailList()
Dim sProject As String
Dim sGroup As String
Form_frmGetEmailList.Visible = True
Set sProject = Forms.Form_frmGetEmailList.Visible.SelectedProject.Value
'Form_frmGetEmailList is the name of the form & SelectedProject
'is the name of the combo box where the user picks the value
{do some stuff with the value that's selected}
End Sub
Clearly Set sProject = Forms.Form_frmGetEmailList.Visible.SelectedProject.Value is not the way to go! Can anyone help?
Thanks,
AKK
I've defined a variable called sProject (it's a string), and the first thing my code does is call up a user form with a combo box. The user then picks a project from the drop-down list. I want to tell Access to make their choice the value for the variable sProject. ie, if I were working in Excel, I think I'd write it something like...
Sub CallEmailList()
Dim sProject As String
Dim sGroup As String
Form_frmGetEmailList.Visible = True
Set sProject = Forms.Form_frmGetEmailList.Visible.SelectedProject.Value
'Form_frmGetEmailList is the name of the form & SelectedProject
'is the name of the combo box where the user picks the value
{do some stuff with the value that's selected}
End Sub
Clearly Set sProject = Forms.Form_frmGetEmailList.Visible.SelectedProject.Value is not the way to go! Can anyone help?
Thanks,
AKK