Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 7th, 2005, 02:21 AM
Authorized User
 
Join Date: Mar 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to akash Send a message via MSN to akash
Default VB 6.0

I have form names stored in database in Text type. I am unable to call to them in the program due to its string type.
if I give form = <formname in the database > it gives error type mismatch
Please help urgently

 
Old March 7th, 2005, 08:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

have you tried using the Forms collection to load the new form?

Dim frmNew As Form
Forms.Add "<<new form name>>"
Set frmNew = Forms.Item(Forms.Count - 1)
frmNew.Show ' or do whatever you like with it

hth
Phil
 
Old March 7th, 2005, 01:52 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

isn't that a little dangerous? what it someone modify the names in the VB project? (I saw this happens already...)
Anyhow, Phil suggestion is correct.
Marco
 
Old March 8th, 2005, 05:44 AM
Authorized User
 
Join Date: Mar 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to akash Send a message via MSN to akash
Default

thx phil

Although I have tried your solution it gives error invalid property value at forms.add line
let me explain you my problem in detail I have many forms in my project depending on type of user I am to show a particular form. So
i have created a table in ACCESS and stored username and corresponding form name in the datafield as string for ex.

duser(text type) dfrmnm(text type in MSACCES)
A form1
B form2
C form3

Now at the time of excution I wish to show the form corressponding to User automatically.

I hope U have understand my problem

Waiting for your reply


 
Old March 8th, 2005, 05:49 AM
Authorized User
 
Join Date: Mar 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to akash Send a message via MSN to akash
Default

Sorry phil I was doing mistake at forms.add = <name> although it should be forms.add name as told by you.
Now it is working. Thanks a lot again.








Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a VB 2005 exe file on a system without VB dilionyi Pro Visual Basic 2005 3 September 21st, 2009 07:37 PM
How do I write this vb 6 code to work in vb 2008? sanderson Visual Basic 2008 Essentials 3 June 10th, 2008 01:46 PM
Crystal Reports 11 from VB to VB.net koushik_b2002 Crystal Reports 2 June 1st, 2008 01:58 AM
convert dsr file from vb to vb.net Shashi001 VB Components 1 September 22nd, 2006 12:24 PM
converting DTS package from VB 6 to VB .NET petroleo Pro VB Databases 0 August 18th, 2003 05:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.