Input Mask oddity - BUG?

G

Guest

Hi

On my main form I have a continuous subform which includes a date of birth
field (DOB) for each record (in the detail section), set as follows:
Format dd/mm/yyyy
Imput mask 00/00/00;0;_

This works nicely, so that the user only has to enter 6 numbers, and
underscore characters appear in the field to denote where each character will
go before the user types, together with an automatic "/" between the dd/mm/yy
parts of the field. When the textbox loses focus, the century part of the
year is added automatically (19 or 20 prefix.) Nice.

I also have another form where the user can also edit a textbox with this
DOB field (from the same underlying table.) (This form is in "single"
format and is opened by clicking an edit button on the subform which is on
the main form.) However, when I try putting this exact same format and input
mask in for this textbox, it doesn't have any effect. I don't understand
why. I have even tried deleting relationships to see if this might be the
reason, but it hasn't made any difference. I even tried using the Input Mask
Wizard to recreate this input mask and format... all with the same
outcome.... it just doesn't work on this form.

This form has been in existence for a while (as I am developing this
database....) ..but there again, so has the subform on the main form, and
that accepted the input mask no problem. Is this phenomenon (for want of a
better word!) being caused because the calling form and the called form have
the same field.....?
Hmmmmm.........

Any ideas?
Looking forward to your thoughts on this one

Thanks
rich

which are automatically
 
G

Guest

I assume that the problem is with date that bean enterd before the the input
mask,
in that case, try and put on the oncurrent event of the form

If Not IsNull(Me.DOB) Then
Me.DOB= Format(Me.DOB, "dd/mm/yyyy")
End If
 
G

Guest

Hi Ofer

Just as you suggest, the problem is when the date already exists (ie when
the user clicks on the field to edit an existing date.) When I have tried
setting the form to allow additions and opened the form on its own, and have
clicked on the textbox when adding a date for a new record, it puts an
underscore where each character should go, together with a "/" between each
character. The user can also enter any character (ie letters or symbols)
onscreen so the input mask just isn't working properly (it does reject an
entry which doesn't consist of 6 numbers but nevertheless lets the user type
letters in the field in the first place.)

If the field is editing an existing record, the "/" and underscores aren't
displayed. If the user enters, say, 121212, when the user clicks to a new
field, the DOB field displays 12/12/2012 (correct). If the user also types
12/12/12 (including typing in the slashes). the field also displays
12/12/2012. But if the user types in 12122012 or 12/12/2012, the input mask
rejects the entry with the standard message, "The value you entered isn't
appropriate for the input mask..." All of these problems are caused by "/"
and underscores not showing, which could potentially confuse the user.

I have put your code in the oncurrent event of the form. But when the user
clicks on the textbox and types the first character, the field still does not
show the underscore and "/" between characters. I also tried including:
Me.DOB.InputMask = "00/00/00;0;_"
in the code, but it didn't change anything. I also tried putting this
complete code in the DOB textbox's Got Focus event, but this didn't fix it
either.
There must be a way to do this!
Have you got any other thoughts? I'm just trying to get consistency of data
entry method for the user across mulitple forms (whether edting or adding
new.)

Thanks
rich
 
G

Guest

One more try, but please back up your data first.
Create an update query to set the formt of all the fields to the right one

UPDATE TableName SET TableName.DateField= Format([DateField],"dd/mm/yyyy");

I tried it, and it worked fine on existing fields.
please back up
 
G

Guest

I'm not sure where to put this query. Do I just run this query once to
ensure all dates are in the same format? There are only a few (test) records
in the database and they are already all in the same format, appearing in the
table as 12/12/2012.

I know how to create a query in design view but not directly by inputting
SQL (unless it is in a controlsource property box.) If you could clarify I
would be very grateful


Ofer said:
One more try, but please back up your data first.
Create an update query to set the formt of all the fields to the right one

UPDATE TableName SET TableName.DateField= Format([DateField],"dd/mm/yyyy");

I tried it, and it worked fine on existing fields.
please back up
--
I hope that helped
Good luck


Rich1234 said:
Hi Ofer

Just as you suggest, the problem is when the date already exists (ie when
the user clicks on the field to edit an existing date.) When I have tried
setting the form to allow additions and opened the form on its own, and have
clicked on the textbox when adding a date for a new record, it puts an
underscore where each character should go, together with a "/" between each
character. The user can also enter any character (ie letters or symbols)
onscreen so the input mask just isn't working properly (it does reject an
entry which doesn't consist of 6 numbers but nevertheless lets the user type
letters in the field in the first place.)

If the field is editing an existing record, the "/" and underscores aren't
displayed. If the user enters, say, 121212, when the user clicks to a new
field, the DOB field displays 12/12/2012 (correct). If the user also types
12/12/12 (including typing in the slashes). the field also displays
12/12/2012. But if the user types in 12122012 or 12/12/2012, the input mask
rejects the entry with the standard message, "The value you entered isn't
appropriate for the input mask..." All of these problems are caused by "/"
and underscores not showing, which could potentially confuse the user.

I have put your code in the oncurrent event of the form. But when the user
clicks on the textbox and types the first character, the field still does not
show the underscore and "/" between characters. I also tried including:
Me.DOB.InputMask = "00/00/00;0;_"
in the code, but it didn't change anything. I also tried putting this
complete code in the DOB textbox's Got Focus event, but this didn't fix it
either.
There must be a way to do this!
Have you got any other thoughts? I'm just trying to get consistency of data
entry method for the user across mulitple forms (whether edting or adding
new.)

Thanks
rich
 
G

Guest

Yes, try and run this update query once, to set the right format, and then
try editing this fields through the form. I tried it and it gave me the input
mask.
--
I hope that helped
Good luck


Rich1234 said:
I'm not sure where to put this query. Do I just run this query once to
ensure all dates are in the same format? There are only a few (test) records
in the database and they are already all in the same format, appearing in the
table as 12/12/2012.

I know how to create a query in design view but not directly by inputting
SQL (unless it is in a controlsource property box.) If you could clarify I
would be very grateful


Ofer said:
One more try, but please back up your data first.
Create an update query to set the formt of all the fields to the right one

UPDATE TableName SET TableName.DateField= Format([DateField],"dd/mm/yyyy");

I tried it, and it worked fine on existing fields.
please back up
--
I hope that helped
Good luck


Rich1234 said:
Hi Ofer

Just as you suggest, the problem is when the date already exists (ie when
the user clicks on the field to edit an existing date.) When I have tried
setting the form to allow additions and opened the form on its own, and have
clicked on the textbox when adding a date for a new record, it puts an
underscore where each character should go, together with a "/" between each
character. The user can also enter any character (ie letters or symbols)
onscreen so the input mask just isn't working properly (it does reject an
entry which doesn't consist of 6 numbers but nevertheless lets the user type
letters in the field in the first place.)

If the field is editing an existing record, the "/" and underscores aren't
displayed. If the user enters, say, 121212, when the user clicks to a new
field, the DOB field displays 12/12/2012 (correct). If the user also types
12/12/12 (including typing in the slashes). the field also displays
12/12/2012. But if the user types in 12122012 or 12/12/2012, the input mask
rejects the entry with the standard message, "The value you entered isn't
appropriate for the input mask..." All of these problems are caused by "/"
and underscores not showing, which could potentially confuse the user.

I have put your code in the oncurrent event of the form. But when the user
clicks on the textbox and types the first character, the field still does not
show the underscore and "/" between characters. I also tried including:
Me.DOB.InputMask = "00/00/00;0;_"
in the code, but it didn't change anything. I also tried putting this
complete code in the DOB textbox's Got Focus event, but this didn't fix it
either.
There must be a way to do this!
Have you got any other thoughts? I'm just trying to get consistency of data
entry method for the user across mulitple forms (whether edting or adding
new.)

Thanks
rich


:

I assume that the problem is with date that bean enterd before the the input
mask,
in that case, try and put on the oncurrent event of the form

If Not IsNull(Me.DOB) Then
Me.DOB= Format(Me.DOB, "dd/mm/yyyy")
End If
--
I hope that helped
Good luck


:

Hi

On my main form I have a continuous subform which includes a date of birth
field (DOB) for each record (in the detail section), set as follows:
Format dd/mm/yyyy
Imput mask 00/00/00;0;_

This works nicely, so that the user only has to enter 6 numbers, and
underscore characters appear in the field to denote where each character will
go before the user types, together with an automatic "/" between the dd/mm/yy
parts of the field. When the textbox loses focus, the century part of the
year is added automatically (19 or 20 prefix.) Nice.

I also have another form where the user can also edit a textbox with this
DOB field (from the same underlying table.) (This form is in "single"
format and is opened by clicking an edit button on the subform which is on
the main form.) However, when I try putting this exact same format and input
mask in for this textbox, it doesn't have any effect. I don't understand
why. I have even tried deleting relationships to see if this might be the
reason, but it hasn't made any difference. I even tried using the Input Mask
Wizard to recreate this input mask and format... all with the same
outcome.... it just doesn't work on this form.

This form has been in existence for a while (as I am developing this
database....) ..but there again, so has the subform on the main form, and
that accepted the input mask no problem. Is this phenomenon (for want of a
better word!) being caused because the calling form and the called form have
the same field.....?
Hmmmmm.........

Any ideas?
Looking forward to your thoughts on this one

Thanks
rich

which are automatically
 
G

Guest

How do I create this query? I've tried in the query builder without success.
I select DOB from Drivers table, then what? I have never made an update
query before.
How does the following part of the SQL translate into typing into the query
builder?
(ie what goes where?)
SET TableName.DateField= Format([DateField],"dd/mm/yyyy");

(I've even tried typing this in as the control source for a text box, just
so I could access the query builder correctly configured [after having added
the SQL before] just so I could run the query... but Access goes through to
the Expression Builder, not the query builder. As you can tell, I'm a newbie
at this!)

....or where can I just type in the SQL directly for the query, and then run
it?
TIA

Ofer said:
Yes, try and run this update query once, to set the right format, and then
try editing this fields through the form. I tried it and it gave me the input
mask.
--
I hope that helped
Good luck


Rich1234 said:
I'm not sure where to put this query. Do I just run this query once to
ensure all dates are in the same format? There are only a few (test) records
in the database and they are already all in the same format, appearing in the
table as 12/12/2012.

I know how to create a query in design view but not directly by inputting
SQL (unless it is in a controlsource property box.) If you could clarify I
would be very grateful


Ofer said:
One more try, but please back up your data first.
Create an update query to set the formt of all the fields to the right one

UPDATE TableName SET TableName.DateField= Format([DateField],"dd/mm/yyyy");

I tried it, and it worked fine on existing fields.
please back up
--
I hope that helped
Good luck


:

Hi Ofer

Just as you suggest, the problem is when the date already exists (ie when
the user clicks on the field to edit an existing date.) When I have tried
setting the form to allow additions and opened the form on its own, and have
clicked on the textbox when adding a date for a new record, it puts an
underscore where each character should go, together with a "/" between each
character. The user can also enter any character (ie letters or symbols)
onscreen so the input mask just isn't working properly (it does reject an
entry which doesn't consist of 6 numbers but nevertheless lets the user type
letters in the field in the first place.)

If the field is editing an existing record, the "/" and underscores aren't
displayed. If the user enters, say, 121212, when the user clicks to a new
field, the DOB field displays 12/12/2012 (correct). If the user also types
12/12/12 (including typing in the slashes). the field also displays
12/12/2012. But if the user types in 12122012 or 12/12/2012, the input mask
rejects the entry with the standard message, "The value you entered isn't
appropriate for the input mask..." All of these problems are caused by "/"
and underscores not showing, which could potentially confuse the user.

I have put your code in the oncurrent event of the form. But when the user
clicks on the textbox and types the first character, the field still does not
show the underscore and "/" between characters. I also tried including:
Me.DOB.InputMask = "00/00/00;0;_"
in the code, but it didn't change anything. I also tried putting this
complete code in the DOB textbox's Got Focus event, but this didn't fix it
either.
There must be a way to do this!
Have you got any other thoughts? I'm just trying to get consistency of data
entry method for the user across mulitple forms (whether edting or adding
new.)

Thanks
rich


:

I assume that the problem is with date that bean enterd before the the input
mask,
in that case, try and put on the oncurrent event of the form

If Not IsNull(Me.DOB) Then
Me.DOB= Format(Me.DOB, "dd/mm/yyyy")
End If
--
I hope that helped
Good luck


:

Hi

On my main form I have a continuous subform which includes a date of birth
field (DOB) for each record (in the detail section), set as follows:
Format dd/mm/yyyy
Imput mask 00/00/00;0;_

This works nicely, so that the user only has to enter 6 numbers, and
underscore characters appear in the field to denote where each character will
go before the user types, together with an automatic "/" between the dd/mm/yy
parts of the field. When the textbox loses focus, the century part of the
year is added automatically (19 or 20 prefix.) Nice.

I also have another form where the user can also edit a textbox with this
DOB field (from the same underlying table.) (This form is in "single"
format and is opened by clicking an edit button on the subform which is on
the main form.) However, when I try putting this exact same format and input
mask in for this textbox, it doesn't have any effect. I don't understand
why. I have even tried deleting relationships to see if this might be the
reason, but it hasn't made any difference. I even tried using the Input Mask
Wizard to recreate this input mask and format... all with the same
outcome.... it just doesn't work on this form.

This form has been in existence for a while (as I am developing this
database....) ..but there again, so has the subform on the main form, and
that accepted the input mask no problem. Is this phenomenon (for want of a
better word!) being caused because the calling form and the called form have
the same field.....?
Hmmmmm.........

Any ideas?
Looking forward to your thoughts on this one

Thanks
rich

which are automatically
 
G

Guest

First back up

Create a new query, from the menu bar select view > SQL
Paste the SQL I provided you with

SET TableName.DateField= Format([DateField],"dd/mm/yyyy");
Change
TableName = The name of the table the include the field
DateField = the name of the date field in the table above

And run the sql.

--
I hope that helped
Good luck


Rich1234 said:
How do I create this query? I've tried in the query builder without success.
I select DOB from Drivers table, then what? I have never made an update
query before.
How does the following part of the SQL translate into typing into the query
builder?
(ie what goes where?)
SET TableName.DateField= Format([DateField],"dd/mm/yyyy");

(I've even tried typing this in as the control source for a text box, just
so I could access the query builder correctly configured [after having added
the SQL before] just so I could run the query... but Access goes through to
the Expression Builder, not the query builder. As you can tell, I'm a newbie
at this!)

...or where can I just type in the SQL directly for the query, and then run
it?
TIA

Ofer said:
Yes, try and run this update query once, to set the right format, and then
try editing this fields through the form. I tried it and it gave me the input
mask.
--
I hope that helped
Good luck


Rich1234 said:
I'm not sure where to put this query. Do I just run this query once to
ensure all dates are in the same format? There are only a few (test) records
in the database and they are already all in the same format, appearing in the
table as 12/12/2012.

I know how to create a query in design view but not directly by inputting
SQL (unless it is in a controlsource property box.) If you could clarify I
would be very grateful


:

One more try, but please back up your data first.
Create an update query to set the formt of all the fields to the right one

UPDATE TableName SET TableName.DateField= Format([DateField],"dd/mm/yyyy");

I tried it, and it worked fine on existing fields.
please back up
--
I hope that helped
Good luck


:

Hi Ofer

Just as you suggest, the problem is when the date already exists (ie when
the user clicks on the field to edit an existing date.) When I have tried
setting the form to allow additions and opened the form on its own, and have
clicked on the textbox when adding a date for a new record, it puts an
underscore where each character should go, together with a "/" between each
character. The user can also enter any character (ie letters or symbols)
onscreen so the input mask just isn't working properly (it does reject an
entry which doesn't consist of 6 numbers but nevertheless lets the user type
letters in the field in the first place.)

If the field is editing an existing record, the "/" and underscores aren't
displayed. If the user enters, say, 121212, when the user clicks to a new
field, the DOB field displays 12/12/2012 (correct). If the user also types
12/12/12 (including typing in the slashes). the field also displays
12/12/2012. But if the user types in 12122012 or 12/12/2012, the input mask
rejects the entry with the standard message, "The value you entered isn't
appropriate for the input mask..." All of these problems are caused by "/"
and underscores not showing, which could potentially confuse the user.

I have put your code in the oncurrent event of the form. But when the user
clicks on the textbox and types the first character, the field still does not
show the underscore and "/" between characters. I also tried including:
Me.DOB.InputMask = "00/00/00;0;_"
in the code, but it didn't change anything. I also tried putting this
complete code in the DOB textbox's Got Focus event, but this didn't fix it
either.
There must be a way to do this!
Have you got any other thoughts? I'm just trying to get consistency of data
entry method for the user across mulitple forms (whether edting or adding
new.)

Thanks
rich


:

I assume that the problem is with date that bean enterd before the the input
mask,
in that case, try and put on the oncurrent event of the form

If Not IsNull(Me.DOB) Then
Me.DOB= Format(Me.DOB, "dd/mm/yyyy")
End If
--
I hope that helped
Good luck


:

Hi

On my main form I have a continuous subform which includes a date of birth
field (DOB) for each record (in the detail section), set as follows:
Format dd/mm/yyyy
Imput mask 00/00/00;0;_

This works nicely, so that the user only has to enter 6 numbers, and
underscore characters appear in the field to denote where each character will
go before the user types, together with an automatic "/" between the dd/mm/yy
parts of the field. When the textbox loses focus, the century part of the
year is added automatically (19 or 20 prefix.) Nice.

I also have another form where the user can also edit a textbox with this
DOB field (from the same underlying table.) (This form is in "single"
format and is opened by clicking an edit button on the subform which is on
the main form.) However, when I try putting this exact same format and input
mask in for this textbox, it doesn't have any effect. I don't understand
why. I have even tried deleting relationships to see if this might be the
reason, but it hasn't made any difference. I even tried using the Input Mask
Wizard to recreate this input mask and format... all with the same
outcome.... it just doesn't work on this form.

This form has been in existence for a while (as I am developing this
database....) ..but there again, so has the subform on the main form, and
that accepted the input mask no problem. Is this phenomenon (for want of a
better word!) being caused because the calling form and the called form have
the same field.....?
Hmmmmm.........

Any ideas?
Looking forward to your thoughts on this one

Thanks
rich

which are automatically
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top