Connecting Tech Pros Worldwide Help | Site Map

table setting with vba

 
LinkBack Thread Tools Search this Thread
  #1  
Old September 4th, 2006, 09:45 PM
tom taol
Guest
 
Posts: n/a
Default table setting with vba



i want to set inputmask, comment, caption... of fields of the table
using vba.
manual work is difficult.

*** Sent via Developersdex http://www.developersdex.com ***

  #2  
Old September 5th, 2006, 12:05 AM
Allen Browne
Guest
 
Posts: n/a
Default Re: table setting with vba

The code below illustrates how to set the property, creating it if
necessary.

Example usage:
? SetPropertyDAO(CurrentDb.TableDefs("Table1").Field s("Field1"),
"Format", dbText, "Short Date")


Function SetPropertyDAO(obj As Object, strPropertyName As String, intType As
Integer, varValue As Variant, Optional strErrMsg As String) As Boolean
On Error GoTo ErrHandler
'Purpose: Set a property for an object, creating if necessary.
'Arguments: obj = the object whose property should be set.
' strPropertyName = the name of the property to set.
' intType = the type of property (needed for creating)
' varValue = the value to set this property to.
' strErrMsg = string to append any error message to.

If HasProperty(obj, strPropertyName) Then
obj.Properties(strPropertyName) = varValue
Else
obj.Properties.Append obj.CreateProperty(strPropertyName, intType,
varValue)
End If
SetPropertyDAO = True

ExitHandler:
Exit Function

ErrHandler:
strErrMsg = strErrMsg & obj.Name & "." & strPropertyName & " not set to
" & varValue & ". Error " & Err.Number & " - " & Err.Description & vbCrLf
Resume ExitHandler
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"tom taol" <tom@yahoo.comwrote in message
news:44fca0fa$0$34073$815e3792@news.qwest.net...
Quote:
>
>
i want to set inputmask, comment, caption... of fields of the
table using vba.
manual work is difficult.

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.