Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

user defined types

Status
Not open for further replies.

99mel

Programmer
Joined
Oct 18, 1999
Messages
379
Location
GB
When you create a User-Defined Type is it possible to just display all the variable values from the Type keyword.<br>
<br>
Thanks for any help
 
<br>
Not sure what you mean! Can you give a little more detail.
 
Lets say u have the following user-defined data type<br>
<br>
Public Type tabcontents<br>
filename As String<br>
filestart As Integer<br>
filelength As Integer<br>
End Type<br>
<br>
Can u display the filename, filestart and filelength by using the tabcontents name?
 
Nope. You need to reference each member individually. <br>
<br>
<p>nick bulka<br><a href=mailto:nick@bulka.com>nick@bulka.com</a><br><a href= > </a><br>
 
99mel<br>
<br>
what did you want to do exactly?<br>
<br>
Mike<br>
<p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
I have a question regarding the DIM statement. I copied a code from another form that dynamically creates an Access DB.
ex:
Private Sub mnuNew_Click()
Dim newdata
Dim tb As TableDef
Dim fld As Field
Dim indx As Index
Dim DBNaam$
Dim dbNew As Database
'get name of the new database
newdata = InputBox(&quot;What's the name of the database?&quot;)

Screen.MousePointer = vbHourglass
'make database
DBNaam$ = newdata & &quot;.mdb&quot;
Set dbNew = CreateDatabase(DBNaam$, dbLangGeneral, dbVersion30)
'make a table
Set tb = dbNew.CreateTableDef(&quot;Table1&quot;)
'make a date-field
Set fld = tb.CreateField(&quot;Service Date&quot;, dbDate)
tb.Fields.Append fld
'make a meno-field
Set fld = tb.CreateField(&quot;Cost&quot;, dbCurrency)
tb.Fields.Append fld
'make a Yes/No field
Set fld = tb.CreateField(&quot;Odometer&quot;, dbBoolean)
tb.Fields.Append fld
'make a text field with a length of 8 characters
Set fld = tb.CreateField(&quot;Fuel Qty&quot;, dbBoolean)
tb.Fields.Append fld

Set fld = tb.CreateField(&quot;Service Type&quot;, dbText)
tb.Fields.Append fld
dbNew.TableDefs.Append tb



Screen.MousePointer = vbNormal

End Sub

I keep getting a compile error on all of these DIMs because &quot;TableDef&quot; and &quot;Database&quot; are not recognized. i.e they are not in the dropdown as a choice including &quot;createDatabase&quot;. Can anyone tell me what I need to do or what I'm missing somewhere?

Thanks.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top