473,394 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to load multiple User forms

1
I currently writing a program for my QA department where the user has to do the following
Enter a part number in a Text Box (example part number ag782241)
Hit “OK” on a Command Button
The program then hides UserForm1 and then it will search for UserFormag782241
It then shows the UserFormag782241
I have about 500 different part numbers
Right now I have my program to go directly to UserFormag782241
Please help me were I’m a novice in VB
__________________________________________________ ___________________________
Expand|Select|Wrap|Line Numbers
  1. Private Sub btnOK_Click()
  2.  ' Check blanks
  3.  If Trim(TextBox1.Text) <= "" Then
  4.     MsgResp = MsgBox("You must enter PART NUMBER", vbYes, "Part Number")
  5.     TextBox1.SetFocus
  6.      Exit Sub
  7.  End If
  8.  UserForm1.Hide
  9.  UserFormag782241.Show (page1)
Jan 28 '14 #1
2 1046
Luk3r
300 256MB
The logic behind what you're doing should be something like this:

Expand|Select|Wrap|Line Numbers
  1. If textbox.text = "" then
  2. MsgBox("You must enter a part number", vbOKOnly, "Part Number")
  3. textbox1.setfocus
  4. else
  5. dim partNumberForm As New Form
  6. dim frm as Form
  7.  
  8. partNumberForm.Text = "UserForm" + textbox1.text
  9.  
  10. For Each frm In Forms
  11. If frm.text = textbox1.text then
  12. UserForm1.Hide
  13. partNumberForm.Show()
  14. End If
  15. Next
The actual code may be wrong as I was only writing out the logic. Hope it helps!
Jan 28 '14 #2
The logic given here seems absolutely perfect! I think you just implement it and your problem will be solved.
Jan 31 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: David | last post by:
Hi, I have a page that will need to dynamically use 4 different user controls based on a Query String passed to it. Currently I have the @Register for each control and the <tagprefix: tagname> in...
1
by: intl04 | last post by:
Are there any problems with multiple user access to the same Access database on a shared network drive? I have 'shared' chosen for 'default open mode'. As for the record locking properties, I...
1
by: TIM T | last post by:
I want to load a user control from a dll dynamically to my main form. I have been reading about using reflection. I got this to work with the methods from my other classes in the dll but I am not...
2
by: James X. Li | last post by:
Is there a way to implement multiple login forms for ASP.NET applications? With our application we want to implement simple login form for normal resources (downloadable files), but more rigorous...
1
by: MichaƂ Januszczyk | last post by:
I have the following code on my aspx page <%if(user_status==1){%><ctl:state1 runat="server" id="aaa"></ctl:state1><%}else if(user_status==2){%><ctl:state2 runat="server"...
3
by: Saket Mundra | last post by:
I have multiple web forms in my application. The user after logging on is directed to form1 where he enters information desired. Once finished he is directed to form2 and the same procedure goes on...
2
by: John Granade | last post by:
I'm looking for the best way to make a dataset available from multiple Windows forms. The dataset is created from an XML file. I have a main form (frmMain) that loads the dataset and reads the...
2
by: Mario | last post by:
Hi, I am trying to create an application with multiple windows forms. The problem that I have is that after creating the window forms, I do not know how to open formN after closing Main form. ...
2
by: mikeingenito | last post by:
Hello, I have a a web form where i dynamically load a user control. The web page is an issue log, and each user control I add is a specific issue. I load them as follows: Try ...
1
by: Jincythomas | last post by:
I want to load multiple images using drop down list it has to be from database.My project is going to have 3 drop down list on the basis of each selection I need to load the images from...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.