I have a frame and a maskedbox on it. I set the mask of the box to ##:##. The user enters a time. I set the frames property to visible, true or false depending on if the user needs to enter the time. This can happen several times on a form. The first time the frame appears the maskedbox is blank. The second and thereafter it has the time that was entered the first time. I have tried the following to clear the maskedbox after the frame is made visible but it gives me an error. Here is my code:
'-- CUSTOM HOURS FRAME
Frame1.Visible = True
Frame1.ZOrder 0
'-- CLEAR THE MASKEDBOX
MaskEdBox1.Mask = ""
MaskEdBox1.Text = ""
MaskEdBox1.Mask = "##:##"
MaskEdBox1.SetFocus
The error is "invalid procedure call or argument" and its the setfocus that is causing the problem. Any suggestions on how to fix this. I need the set focus in there so the user is ready when the frame is made visible.
Thanks,
Shannan
'-- CUSTOM HOURS FRAME
Frame1.Visible = True
Frame1.ZOrder 0
'-- CLEAR THE MASKEDBOX
MaskEdBox1.Mask = ""
MaskEdBox1.Text = ""
MaskEdBox1.Mask = "##:##"
MaskEdBox1.SetFocus
The error is "invalid procedure call or argument" and its the setfocus that is causing the problem. Any suggestions on how to fix this. I need the set focus in there so the user is ready when the frame is made visible.
Thanks,
Shannan