spilwayboy
Registered User.
- Local time
- Today, 22:03
- Joined
- Dec 17, 2002
- Messages
- 17
I have some combo boxes that have the not in list event procedure set to this code and the code works great for adding new records to tables. Here is the problem. I used a string command like "Me![City] = StrConv(Me![City], 3)" to capitalize the first letter of each word and had it in the after update of the control. the problem is that the code does not capitalize the first letter when adding the record to the table they go in as all lower case. I tired modifying the code above and putting it before the message box in this code but it still does not capitalize the first letter. Is this the wrong code? Is there another way to do it that I am missing? Any help would be appreciated.
Private Sub strEquipmentDescription_NotInList(NewData As String, Response As Integer)
Response = MsgBox("The equipment description you have entered is not in this list." & vbCrLf & vbCrLf _
& "Would you like to add it?", vbQuestion + vbYesNo, "New Equipment Description")
If Response = vbYes Then
Dim db As Database, rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("EquipmentDescription")
With rs
.AddNew
.Fields("EquipmentDescription") = NewData
.Update
End With
Response = acDataErrAdded
Else
Me.Undo
Response = acDataErrContinue
End If
End Sub
Thanks,
Spil
Private Sub strEquipmentDescription_NotInList(NewData As String, Response As Integer)
Response = MsgBox("The equipment description you have entered is not in this list." & vbCrLf & vbCrLf _
& "Would you like to add it?", vbQuestion + vbYesNo, "New Equipment Description")
If Response = vbYes Then
Dim db As Database, rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("EquipmentDescription")
With rs
.AddNew
.Fields("EquipmentDescription") = NewData
.Update
End With
Response = acDataErrAdded
Else
Me.Undo
Response = acDataErrContinue
End If
End Sub
Thanks,
Spil