Optional Input mask

mohammadagul

PrinceAtif
Local time
Today, 22:40
Joined
Mar 14, 2004
Messages
298
Hello and Hi,

A couple of Days Back i had Asked a Question about changing the default value of field in a table from a form. I was granted with the following answer and Code


Dim i As Variant
Dim j As Variant

For i = 0 To CurrentDb.TableDefs.Count - 1
For j = 0 To CurrentDb.TableDefs(i).Fields.Count - 1
If CurrentDb.TableDefs(i).Name = "tblInvoices" And _
CurrentDb.TableDefs(i).Fields(j).Name = "Invoice" Then
MsgBox "Please Wait, Changes Are Being Made.", vbInformation, "Defining Invoice."
CurrentDb.TableDefs(i).Fields(j).DefaultValue = True
MsgBox "Congratulation!Changes Made Successfully", vbOKOnly, "Congratulation"

End If
Next j
Next i

now Presently i am trying to set the Input mask through this code. but it doesnt accepts the Input Mask Criteria. What i want i that i could choose a number of input Masks from a Field in a Form and then press the button to make that Input Mask as the Defalut data entry Mask for all my form.

Can it be done? If yes please provide me with some clue to do it
 
Hi m,

Don't know if you can set that for a table. For a control on a form it is
really easy though:

Me.Control.InputMask = "SomeMask"

I'll research and let you know ...

Wayne
 
hi

thanks for the quick reply,

i liked you idea but one thing is that even if i decide to chose the input mask in form how ami going to set the range of inputmasks ina text box?
 
m,

Select one out of a combo-box, then assign it to a control.

Wayne
 
well thanks for the suggestions Wayne, but your idea will only work if the Field to whihc i have to assgne input Mask is in the same form. what if the field is in the different form. the code i had mentioned above is used in chainging the default value of a field inthe table so when i want tochange the defalt value idont have to go to the table and change it there i just select some criteria , in the textbox and click the button to chage the default value of field as per the textbox in my form. this is what i am exactly looking for.

Any chance to do so.... Please Let me know.

Thanks
 
Any Bright Ideas...
I want to be able to change the Input Mask In my table from optional Textboxes in my form... Anything to start would be appretiated.
 

Users who are viewing this thread

Back
Top Bottom