G
Guest
I am trying to do a couple of things with field and control on a form, rather
like a switchboard. Basically, I want my users to sign in and the
UsersSignIn value to populate the Users field in 2 other forms. After that, I
want them to click a button which will open the main form and go to a new
record.
I can figure out how to open the form to new record in a macro, but I cannot
get the fields to hold the value in a macro, and I can’t figure out how to do
all the requests in VBA. Mainly because I am not a programmer, and none of
my IT people know VBA. I am sorry to ask, but can you help me figure out the
code, and draw pictures since I am an idiot??
The tables and fields are:
Form Function Form Name Field Result
Open Form Users UsersSignIn Value in Field populates next 2
forms
Main Form IB Performance Users Holds value from UsersSignIn field above
Sub Form Accounts subform Users Holds value from UsersSignIn field above
Command Button OpenFormCommand3 Should open IB Performace to new record &
allow the above to hold true as well
The code I am using so far is:
Private Sub Combo1_Change()
If Form_User.Combo1.Text <> "" Then
Set [Form_IB Performance].User.Text = Form_User.Combo1.Text
Set [Form_Accounts subform].User.Text = Form_User.Combo1.Text
End If
End Sub
Private Sub UsersSignIn_Click(Cancel As Integer)
On Error GoTo Err_Combo1_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "IB Performance"
stLinkCriteria = "[UsersSignIn]=" & Me![User]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_UsersSignIn_Click:
Exit Sub
Err_UsersSignIn_Click:
MsgBox Err.Description
Resume Exit_UsersSignIn_Click
End Sub
Private Sub UsersSignIn_Click()
End Sub
like a switchboard. Basically, I want my users to sign in and the
UsersSignIn value to populate the Users field in 2 other forms. After that, I
want them to click a button which will open the main form and go to a new
record.
I can figure out how to open the form to new record in a macro, but I cannot
get the fields to hold the value in a macro, and I can’t figure out how to do
all the requests in VBA. Mainly because I am not a programmer, and none of
my IT people know VBA. I am sorry to ask, but can you help me figure out the
code, and draw pictures since I am an idiot??
The tables and fields are:
Form Function Form Name Field Result
Open Form Users UsersSignIn Value in Field populates next 2
forms
Main Form IB Performance Users Holds value from UsersSignIn field above
Sub Form Accounts subform Users Holds value from UsersSignIn field above
Command Button OpenFormCommand3 Should open IB Performace to new record &
allow the above to hold true as well
The code I am using so far is:
Private Sub Combo1_Change()
If Form_User.Combo1.Text <> "" Then
Set [Form_IB Performance].User.Text = Form_User.Combo1.Text
Set [Form_Accounts subform].User.Text = Form_User.Combo1.Text
End If
End Sub
Private Sub UsersSignIn_Click(Cancel As Integer)
On Error GoTo Err_Combo1_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "IB Performance"
stLinkCriteria = "[UsersSignIn]=" & Me![User]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_UsersSignIn_Click:
Exit Sub
Err_UsersSignIn_Click:
MsgBox Err.Description
Resume Exit_UsersSignIn_Click
End Sub
Private Sub UsersSignIn_Click()
End Sub