Hi there,
I'm new to Access but I have a lot of experience with Excel and also with VBA in Excel.
I'm trying to use VBA to achieve the following on an Access form:
I have four ComboBoxes, with names "cboBew1" - "cboBew4". I also have another ComboBox "cboTN1". I am trying to get my macro to run through the 4 Boxes and add the displayed contents of these boxes to the drop down menu of cboTN1. Here's my code:
Function Makro1()
Dim i As Long
With Forms("Daten - Formular")
For i = 1 To 4
strItem = .Controls("cboBew" & i).Value
.cboTN1.AddItem Item:=strItem, Index:=0
Next
End With
End Function
When I run the code, cboTN1 is empty although there should be 4 entries. What am I doing wrong? Also how would I deal with the possibiliby of one of the 4 ComboBoxes being empty.
Kind regards
Martin