chobo321321
Registered User.
- Local time
- Yesterday, 21:00
- Joined
- Dec 19, 2004
- Messages
- 53
I'm completely lost on this one. I'm working on an "add record" button, but I have to populate fields from two different tables with it.
All the fields except the "Genre" Field are from the same table
This is what I have so far, as you can see I'm currently only opening a recordset from one table.
All the fields except the "Genre" Field are from the same table

This is what I have so far, as you can see I'm currently only opening a recordset from one table.
Code:
Private Sub cmdAddRecord_Click()
Dim conAdd As ADODB.Connection
Dim rstAdd As ADODB.Recordset
Dim strSQL As String
Set conAdd = CurrentProject.Connection
Set rstAdd = New ADODB.Recordset
strSQL = "SELECT * FROM tblAlbums"
rstAdd.Open strSQL, conAdd, adOpenStatic, adLockOptimistic
With rstAdd
.AddNew
!Album = Me.txtAlbum.Value
!NOT = Me.txtNOT.Value
!YOR = Me.txtYOR.Value
!Artist = Me.txtArtist.Value
!RecordLabel = Me.txtRecordLabel.Value
!GenreID = Me.cboGenreID.Value ''From different table
.Update
.Close
End With
Set rstAdd = Nothing
Set conAdd = Nothing
End Sub