Results 1 to 2 of 2

Thread: Changing "Input Mask" in ms access with code

  1. #1

    Thread Starter
    Member Shadow45o's Avatar
    Join Date
    Sep 2008
    Posts
    51

    Question Changing "Input Mask" in ms access with code

    Ok...I have bee searching around google with no luck..so now I'm asking...

    How would I go about changing the input mask in MS Access with visual basic code...I am using CREATE TABLE

    Here is the code of the code...

    The below code creates a new table with in my main database(.mdb) and changes the text property and makes it required, but I also want to be able to change the Input Mask to be password

    vb Code:
    1. Dim oConn As OleDbConnection
    2.         Dim oComm As OleDbCommand
    3.         Dim oConnect, oQuery As String
    4.  
    5.         oConnect = strConnection
    6.  
    7.         oQuery = "CREATE TABLE AccessTest (ID Counter," & _
    8.                 "Name TEXT(50) NOT NULL," & _
    9.                 "PRIMARY KEY(ID))"
    10.  
    11.         oConn = New OleDbConnection(oConnect)
    12.         oComm = New OleDbCommand(oQuery, oConn)
    13.  
    14.         Try
    15.             oConn.Open()
    16.  
    17.             oComm.ExecuteNonQuery()
    18.  
    19.             oConn.Close()
    20.         Catch ex As OleDb.OleDbException
    21.         Catch ex As Exception
    22.             MsgBox(ex.Message & vbCrLf & ex.StackTrace)
    23.  
    24.         Finally
    25.             If Not (oConn Is Nothing) Then
    26.                 oComm.Dispose()
    27.                 oComm = Nothing
    28.             End If
    29.         End Try

    This code works perfectly so far...I just can't figure out how to change the input mask...I am pretty good with vb, slightly new to databases

    Thanks in advance for any help...
    Last edited by Shadow45o; Nov 5th, 2009 at 08:23 AM.

  2. #2

    Thread Starter
    Member Shadow45o's Avatar
    Join Date
    Sep 2008
    Posts
    51

    Re: Changing "Input Mask" in ms access with code

    Anyone have any ideas or a place I could go to find out...I have tried a lot of different things with no luck...

    All I need is ta be able to change, in this case, the name column to have an Input Mask that is set for a password. I didn't think it would be hard...but I have had no luck...any ideas?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width