Results 1 to 9 of 9
  1. #1
    deiniolj is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2009
    Location
    Wales
    Posts
    40

    Problems with creating Multiple Input Masks

    I have form with a combo box and a text field, the combo box has software titles in it and the textbox is for the serial numbers. Depending what is chosen in the combo box the input mask will change (That works) but is also remembers the mask. So if I add a software package with no serial or no mask needed is uses the mask from the previous time. I need help with clearing the textfield of the mask or having a universal on for the rest of the titles. I will only need around 10 mask from the 30 or so titles I have in the combo box.

    Help This has been driving me nuts for 2 days..

    Code below.

    Private Sub SW09_Serial_BeforeUpdate(Cancel As Integer)
    Dim Assistive7 As String

    Assistive7 = Me.Assistive_07



    Select Case Assistive7
    Case "Audio Notetaker V2"
    Me.SW09_Serial.InputMask = ">&&\->&&&\->&&&&&\->&&&&&\->&&&&&\->&&&&;;_"
    Case "textHELP Read and Write GOLD V9"
    Me.SW09_Serial.InputMask = ">&&&&&&\->&&&&\->&&&&\->&&&&;;_"
    Case "Dragon N/S Premium Edition V11 + Headset"
    Me.SW09_Serial.InputMask = ">&&&&&\->&&&\->&&&&\->&&&&\->&&;;_"
    Case "Olympus Sonority"
    Me.SW09_Serial.InputMask = ">&&&&\->&&&&\->&&&&\->&&&&\->&&&&;;_"
    End Select
    End Sub

  2. #2
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,044
    Hi,

    maybe add a case Else instruction?

    Case "Audio Notetaker V2"
    Me.SW09_Serial.InputMask = ">&&\->&&&\->&&&&&\->&&&&&\->&&&&&\->&&&&;;_"
    ..........................
    Case Else
    Me.SW09_Serial.InputMask = ""
    End Select

    gr
    NG

  3. #3
    deiniolj is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2009
    Location
    Wales
    Posts
    40
    Doesn't work, when you go on to the next record the input mask is still there, so if the software is different i.e 5 digit long instead of 15 digit like the last record you get the error about the "the value you entered doesn't isn't appropriate for the input mask."

    ?

  4. #4
    deiniolj is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2009
    Location
    Wales
    Posts
    40
    I fixed it, noticed after some playing. when i changed the list to something without a mask and filled in the previous mask and tabbed away to another field. It got ride of the previous mask so then you could shift tab back in and add the proper serial. So I changed the event from BeforeUpdate to On Enter and it works. Mask changed to whatever is in the combo box. Thanks for the extra line you gave me NoellaG.

    This was a head scratcher for 2 days..

    =-)

  5. #5
    deiniolj is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2009
    Location
    Wales
    Posts
    40
    To get this working better I added it to the onload command of the form. But I get a error message. "Invalid use of NULL" because some fields are blank. How do I get it to ignore these..

  6. #6
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,044
    Hi,

    use the NZ function, its syntax:

    NZ(Variable,Value when variable is null)

    NZ([MyTextField],"") will return the value of the field [MyTextField], but return an empty string when the field is empty

    gr
    NG

  7. #7
    deiniolj is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2009
    Location
    Wales
    Posts
    40
    You are a star NoellaG

  8. #8
    deiniolj is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2009
    Location
    Wales
    Posts
    40
    What's the best way to get this working with a rpt. I have tried the onload command, but it doesn't work with the print preview I get a error.

    Anybody

  9. #9
    deiniolj is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2009
    Location
    Wales
    Posts
    40
    Also is there a way instead of the input mask, actual details are inputed. i.e if it say's Anti virus then

    Case "Anti Virus"
    Me.SW09_Serial (What should go here to populate the fields with "N/S")

    Thx

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Creating a input form...?
    By DarrenReeder in forum Access
    Replies: 4
    Last Post: 01-07-2011, 03:26 PM
  2. Creating input box for query
    By dcecil in forum Queries
    Replies: 1
    Last Post: 06-23-2009, 10:08 AM
  3. Validation and Input masks
    By Santi in forum Access
    Replies: 3
    Last Post: 03-26-2009, 10:53 AM
  4. can a field have 2 different input masks
    By cjamps in forum Database Design
    Replies: 1
    Last Post: 03-21-2009, 02:47 PM
  5. Database Form Input Masks
    By scartmell in forum Forms
    Replies: 1
    Last Post: 08-12-2008, 01:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums