Data entry format

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Reed

    Data entry format

    Is there any way that I can enforce an input mask when I am asking a user to
    input criteria? An example would be:

    SELECT Peeps.[First Name], Peeps.Surname, Peeps.DOB
    FROM Peeps
    WHERE (((Peeps.DOB) Like [Enter Month]));

    I would like the box to come up with something like "Enter month __/__/__"
    so that all they enter are numeric values only and no slashes. Any help
    would be greatly appreciated.

    Mark


  • Larry  Linson

    #2
    Re: Data entry format

    "Mark Reed" wrote
    [color=blue]
    > Is there any way that I can enforce an
    > input mask when I am asking a user to
    > input criteria? An example would be:
    >
    > SELECT Peeps.[First Name], Peeps.Surname, Peeps.DOB
    > FROM Peeps
    > WHERE (((Peeps.DOB) Like [Enter Month]));[/color]

    Create a Form on which you provide Controls into which the user enters, or
    from which the user selects the criteria. Then use what is entered to create
    the WhereCondition argument of DoCmd.OpenForm or DoCmd.OpenRepor t; or use
    what is entered to build an SQL string that you pick up and substitute for
    the RecordSource in the Open event of the Form or Report.

    You can't do what you want by creating a Parameter query, as you have done.

    Larry Linson
    Microsoft Access MVP





    Comment

    • Trevor Best

      #3
      Re: Data entry format

      On Sat, 24 Jan 2004 00:47:15 -0000 in comp.databases. ms-access, "Mark
      Reed" <mark.reed75@nt lworld.com> wrote:
      [color=blue]
      >Is there any way that I can enforce an input mask when I am asking a user to
      >input criteria? An example would be:
      >
      >SELECT Peeps.[First Name], Peeps.Surname, Peeps.DOB
      >FROM Peeps
      >WHERE (((Peeps.DOB) Like [Enter Month]));
      >
      >I would like the box to come up with something like "Enter month __/__/__"
      >so that all they enter are numeric values only and no slashes. Any help
      >would be greatly appreciated.[/color]

      Create a popup form with a textbox with required input mask, then the
      query can look something like:

      select .... where dob like forms!MyPopupFo rm!MyTextBox

      May need playing with a bit, the resulting reference to an input
      masked textbox may not be quite what you expect.

      --
      A)bort, R)etry, I)nfluence with large hammer.

      Comment

      Working...