I am back again.
I have changed Default View of Form "Item File" to Continuous Forms and put List box on the detail section under the controls which are in a row and list box is populated with all above controls under txtMfgDate in List box i am showing field MfgDate.
When month abbreviation is mis-spelled in "txtMfgDate" after display of custom message box focus moves to next control ExpDate and does not returns focus to "txtMfgDate"
Private Sub txtMfgDate_AfterUpdate()
Dim strMonth As String
strMonth = Left(Me.txtMfgDate.Text, 3)
Select Case strMonth
Case "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
' Month name OK - update the underlying field
Me.MfgDate = CDate(Me.txtMfgDate)
MsgBox "You must enter a valid month abbreviation: " & vbCrLf & _
"Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec", vbExclamation, "Month abbreviation mis-spelled"
What if user only enters month abbrv. and leaves dash and year, then we get message "Type mismatch" and on clicking Debug and on vb editor it highlights the line ==> Me.MfgDate = CDate(Me.txtMfgDate).
There should be some restriction to enter complete pattern or some sort of custom msgbox.
I tried to put input mask of this control with LLL\-0000;0; if year part is missing then i get message "The value you entered isn't appropriate for the input mask 'LLL\0000;' specified for this field.
Posted by: firstname.lastname@example.org
|Reply via web post||•||Reply to sender||•||Reply to group||•||Start a New Topic||•||Messages in this topic (25)|