Hello all,
I am still learning VB so I apologize if this comes across as a mindless request. I am implementing a range check for a data entry database. I am asking the user to input the month. If they enter anything >12 then the msgbox pops up, with vbRetry clearing the invalid value and requesting the user input a valid value. The user also has the option to select vbCancel. If the user selects vbCancel from the msgbox, I would like the values for all fields of that record to be cleared or "nulled" so that the user may re-enter in the correct values for all fields. Below I have included the VB code I have so far. The break in red is where I believe the vbCancel will appear. Unfortunately, I am having a difficult time coding this. Any help would be greatly appreciated! Thanks
If Me.NewMonth > 12 Then
If MsgBox("The month entered is invalid, select retry and enter a valid month", vbRetryCancel) = vbRetry Then
Me.NewMonth = Null
'i think this is where vbcancel will go?'
Exit Sub
End If
End If
I am still learning VB so I apologize if this comes across as a mindless request. I am implementing a range check for a data entry database. I am asking the user to input the month. If they enter anything >12 then the msgbox pops up, with vbRetry clearing the invalid value and requesting the user input a valid value. The user also has the option to select vbCancel. If the user selects vbCancel from the msgbox, I would like the values for all fields of that record to be cleared or "nulled" so that the user may re-enter in the correct values for all fields. Below I have included the VB code I have so far. The break in red is where I believe the vbCancel will appear. Unfortunately, I am having a difficult time coding this. Any help would be greatly appreciated! Thanks
If Me.NewMonth > 12 Then
If MsgBox("The month entered is invalid, select retry and enter a valid month", vbRetryCancel) = vbRetry Then
Me.NewMonth = Null
'i think this is where vbcancel will go?'
Exit Sub
End If
End If