Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add data to combobox

Status
Not open for further replies.
Mar 27, 2002
168
NL
I get a function for this with 2 columns but now I need for three. I'll tried:
'Om locaties toe te voegen
Function Append2Table4(cbo As ComboBox, NewData As Variant) As Integer
On Error GoTo err_append2table4
Dim rst As DAO.Recordset

Dim vField1, vField2 As Variant

Append2Table4 = acDataErrContinue
vField1 = "loc_beschrijving"
vField2 = "loc_werkbonID"
If Not IsNull(NewData) Then
If Bevestigen("Wilt u " & NewData & " toevoegen aan de lijst met locaties?") Then
Set rst = CurrentDb.OpenRecordset(cbo.RowSource)
rst.AddNew
rst(vField1) = NewData
rst(vField2) = TempWerkbonID
rst.Update
rst.Close
Append2Table4 = acDataErrAdded
End If
End If

exit_append2table4:
Set rst = Nothing
Exit Function
err_append2table4:
MsgBox Err.Description
Resume exit_append2table4
End Function
but it failed on rst = currentdb.recordset(cbo.recordsource)
error: to few parameters, 1 expected

anyone understand the problem, thnx
Gerard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top