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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert string to represent opject type 1

Status
Not open for further replies.

timotai

Technical User
Apr 13, 2002
119
0
0
GB
Hi All

I have the following code to transfer objects to other access databases. I have created a form to provide the necessary information such as object type, name, destination to make it easy just to select the options and then transfer the selected database objects.

Code:
DoCmd.TransferDatabase transfertype:=acExport, _
databasetype:="Microsoft Access", _
databasename:=Me.cmbDestination, _
ObjectType:=Me.cmbObjType.Column(1),
Source:=Me.cmbObjName, _
Destination:=Me.cmbObjName

I am retrieving the options from combo boxes. Where I am getting the problem is with the ObjectType. Because the output from the combo box is a string I get a Type mismtach error. If i remove the reference to the combo box and enter an object tpye in (e.g. acModule) it works fine, so I know the rest of the expression must be ok. I have been looking for ways to get it to treat the string literally but have been unsuccessful.

Any ideas??

Help appreciated as always.

Thanks

Tim
 
The types are all numbers. To find out the numbers, open the debug window (press Ctrl+G) and enter something like:
Code:
? acTable
Do the same for other types so you can find all of the numbers.

Duane
Hook'D on Access
MS Access MVP
 
Thanks that worked a treat!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top