Create Access field with Inputmask 
Author Message
 Create Access field with Inputmask

I am building an Access database from scratch using VB code. Can anybody
tell me how to create a field with an Inputmask?
Thanks.

Willy Haesen



Tue, 27 Feb 2001 03:00:00 GMT  
 Create Access field with Inputmask
Hi Willy,
My first question is "Why?". It's easier to just build plain text fields in
Access interface and apply all text formatting in the lost focus event or
keypress event of your VB textboxes and combos. This controls the
input/result.  feed the result to the plain text field in the Access db.
When you call it up, it has the formatting and your program doesn't have a
lot of useless overhead.
If you don't have Access, you can create a run once program in VB to create
the database and tables and then 'talk' to it from the final program.

Make sense?

hope it helps.
don

Quote:
>I am building an Access database from scratch using VB code. Can anybody
>tell me how to create a field with an Inputmask?
>Thanks.

>Willy Haesen




Tue, 27 Feb 2001 03:00:00 GMT  
 Create Access field with Inputmask
Try the function below:

Function AddUpdateMask(strDataBase as String, strTable As String, strField
As String, strMask As String)
Dim db As Database
Dim tdf As TableDef
Dim fld As Field
Dim prp As Property

Set db = OpenDatabase(strDataBase)
Set tdf = db.TableDefs(strTable)
Set fld = tdf.Fields(strField)

On Error Resume Next
fld.Properties("InputMask") = strMask
If Err.Number <> 0 Then
    Set prp = fld.CreateProperty("InputMask", dbText, strMask)
    fld.Properties.Append prp
End If
End Function

Junior

Willy HAESEN escreveu na mensagem

Quote:
>I am building an Access database from scratch using VB code. Can anybody
>tell me how to create a field with an Inputmask?
>Thanks.

>Willy Haesen




Sat, 03 Mar 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Referencing Field Properties InputMask and Format, using VB/VBA

2. Trouble adding InputMask property to fields...

3. InputMask and Access Error codes

4. Aquivalent .inputmask, Access-97 -> VB 6.0

5. VBA - Access 2000 Create a table and access the fields

6. Problem In Creating Field Properies (Access 97)

7. Create Hyperlink, OLE Object Field via Access SQL

8. Dynamically creating fields - Access 95

9. Creating a Word doc from Access and Problems with Memo field

10. MS Access Creating a field to computate compound interest

11. Access the Options fields when creating new mail

12. Create word document from access OLE field

 

 
Powered by phpBB® Forum Software