B
Brennan
Hello:
I have a main form named Statements and a Subform name
Statement Details that sits on the main form. There is a
combo box called Accounts that provides a list of
accounts that the user can choose from to add to a
statement. The combo box references tha Accounts table
to get it's values.
There are 2 additional fields in the statement detail
subform called Account Number and Amount. These are also
fields that are present in the Accounts table.
What I would like to accomplish is to programtically
update these 2 fields using the respective values from
the Accounts table after the user selects an account
using the Accounts combo box.
I tried using the following code in the AfterUpdate
property of the Accounts comboc box but it didn't work:
Private Sub Contractor_AfterUpdate()
Dim sSQL As String
sSQL = "Select tblAccounts_AccountID,
tblAccounts_AccountNum from tblAccounts
where " & "tblAccounts_AccountID=" & Me!AccountID
AccountNum = sSQL
End Sub
Any suggestions would be appreciated
Thanks,
Brennan
I have a main form named Statements and a Subform name
Statement Details that sits on the main form. There is a
combo box called Accounts that provides a list of
accounts that the user can choose from to add to a
statement. The combo box references tha Accounts table
to get it's values.
There are 2 additional fields in the statement detail
subform called Account Number and Amount. These are also
fields that are present in the Accounts table.
What I would like to accomplish is to programtically
update these 2 fields using the respective values from
the Accounts table after the user selects an account
using the Accounts combo box.
I tried using the following code in the AfterUpdate
property of the Accounts comboc box but it didn't work:
Private Sub Contractor_AfterUpdate()
Dim sSQL As String
sSQL = "Select tblAccounts_AccountID,
tblAccounts_AccountNum from tblAccounts
where " & "tblAccounts_AccountID=" & Me!AccountID
AccountNum = sSQL
End Sub
Any suggestions would be appreciated
Thanks,
Brennan