J
JaneM
I have an expression to enter data into drop-downs automatically, but
it did not work. Could you tell me what went wrong?
Private Sub Industry_Type_NotInList(NewData As String, Response As Integer)
Dim dbsProjects2 As DAO.Database
Dim rstIndustry_Type As DAO.Recordset
Dim intAnswer As Integer
On Error GoTo ErrorHandler
intAnswer = MsgBox("Add " & NewData & " to the list of industry types?", _
vbQuestion + vbYesNo)
If intAnswer = vbYes Then
Set dbsProjects2 = CurrentDb
Set rstIndustry_Type = dbsProjects2.OpenRecordset("Industry Type")
rstIndustry_Type.AddNew
rstIndustry_Type![Industry Type] = NewData
rstIndustry_Type.Update
Response = acDataErrAddedElse
Response = acDataErrDisplayEndIf
rstIndustry_Type.Close
dbsProjects2.Close
Exit Sub
Thanks in advance.
Jane Marlotty
it did not work. Could you tell me what went wrong?
Private Sub Industry_Type_NotInList(NewData As String, Response As Integer)
Dim dbsProjects2 As DAO.Database
Dim rstIndustry_Type As DAO.Recordset
Dim intAnswer As Integer
On Error GoTo ErrorHandler
intAnswer = MsgBox("Add " & NewData & " to the list of industry types?", _
vbQuestion + vbYesNo)
If intAnswer = vbYes Then
Set dbsProjects2 = CurrentDb
Set rstIndustry_Type = dbsProjects2.OpenRecordset("Industry Type")
rstIndustry_Type.AddNew
rstIndustry_Type![Industry Type] = NewData
rstIndustry_Type.Update
Response = acDataErrAddedElse
Response = acDataErrDisplayEndIf
rstIndustry_Type.Close
dbsProjects2.Close
Exit Sub
Thanks in advance.
Jane Marlotty