H
H. Martins
Note: KMaster fields are Key Fields, KSlave Fields are the connections
to the tables where KMasters are located.
Hi have a couple combo boxes connected to two tables. In both first
column has keymaster, second column some data to be selected. Both
comboboxes have RowSource but no ControlSource properties.
Then I have a button to add a record. That button's OnClick is (see
the remarks under after ' ):
Dim rs As DAO.Recordset
Dim strSelect As String
strSelect = "SELECT tblAccoes.lintNSerieAlunoAccaoKMaster,
tblAccoes.lintNAlunoKSlave, tblAccoes.lintTurmaKSlave FROM tblAccoes;"
Set rs = DBEngine(0)(0).OpenRecordset(strSelect)
'Now, I want to add a record to tblAccoes whose KSlave fields point to
Kmaster fields pointed by cmbbxAccao and cmbbxAluno.
rs.AddNew
[tblAccoes!lintTurmaKSlave] = cmbbxAccao.Column(0) 'this column
has the respective KMaster value
[tblAccoes!lintNAlunoKSlave] = cmbbxAluno.Column(0) 'this column
has the respective KMaster value
rs.Close
Set rs = Nothing
Problem is: no record is added.
Can I have some help, please?
Henry
to the tables where KMasters are located.
Hi have a couple combo boxes connected to two tables. In both first
column has keymaster, second column some data to be selected. Both
comboboxes have RowSource but no ControlSource properties.
Then I have a button to add a record. That button's OnClick is (see
the remarks under after ' ):
Dim rs As DAO.Recordset
Dim strSelect As String
strSelect = "SELECT tblAccoes.lintNSerieAlunoAccaoKMaster,
tblAccoes.lintNAlunoKSlave, tblAccoes.lintTurmaKSlave FROM tblAccoes;"
Set rs = DBEngine(0)(0).OpenRecordset(strSelect)
'Now, I want to add a record to tblAccoes whose KSlave fields point to
Kmaster fields pointed by cmbbxAccao and cmbbxAluno.
rs.AddNew
[tblAccoes!lintTurmaKSlave] = cmbbxAccao.Column(0) 'this column
has the respective KMaster value
[tblAccoes!lintNAlunoKSlave] = cmbbxAluno.Column(0) 'this column
has the respective KMaster value
rs.Close
Set rs = Nothing
Problem is: no record is added.
Can I have some help, please?
Henry