473,396 Members | 2,029 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,396 software developers and data experts.

Acessing forms dynamically

KodeKrazy
Not sure exactly what I should be asking other than is there a way to get the code below (with modifications) to work. What I want to be able to do is to pass the name of the Form and the name of the ComboBox control to the Sub and have it add the "default" text at the top of the DD List based on which tool the user is currently using. Subsequently it will add the rest of the values from the database to the list.

Any help or suggestions are appreciated.

Thanks,

KK

Expand|Select|Wrap|Line Numbers
  1.         Public Sub fillCatalogCombo(ByVal frmName As Form, ByVal cbobxName As String)
  2.  
  3.         Dim CatCboFill As New linqFillCatalogCboDataContext
  4.         Dim topText As String = ""
  5.         Dim frmText As String = frmName.Name.ToString
  6.         Select Case frmText
  7.             Case "frmSearchItems"
  8.                 topText = "All Catalogs"
  9.             Case "frmItemMaintenance"
  10.                 topText = "Enter or Select"
  11.         End Select
  12.  
  13.         frmName.cbobxName.Items.Add(topText)
  14.  
  15.         Dim Cats = From c In CatCboFill.sp_FillItemSearchCatalogCbo Select c
  16.         For Each Cat In Cats
  17.             frmName.cbobxName.Items.Add(Cat.Description.ToString)
  18.         Next
  19.         CatCboFill = Nothing
  20.  
  21.     End Sub
Jul 9 '08 #1
1 802
Plater
7,872 Expert 4TB
If you have a public instance of the form (note, creating another isntance does NOT work) you can manipulate them directly.
Jul 9 '08 #2

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

Similar topics

6
by: ALthePal | last post by:
Hi, I'm not sure if we are able to or even how to loop through the web forms in a VB.NET project during design time. In MSAccess we are able to go through the database -> forms collection and...
6
by: JonS. | last post by:
Hi, I'm trying to create a Windows Forms portal application and need some help. What I currently have is a main application (.exe) containing an MDI form. The idea is that this main application...
2
by: sandy | last post by:
Hi, I am trying to make a series of forms to configure an ISA server using ASP.net but when i try to access ISA objects from ASP.NET, i get a permission denied error I have removed anonymous...
1
by: Philip | last post by:
Hi, first of all I'm new to this whole .net thing so please forgive my ignorance. Now I have a C++ object with me, and I want to be able to call its methods from VB.net. e.g. Foo::Foo { }...
12
by: Peter Van Wilrijk | last post by:
Hi, In VB6 I have the following code ... Dim frmLink As Form Set frmLink = Forms.Add(stringformname) frmLink.Show 'wait until all data has been loaded Do Until frmLink.Loaded = 21 DoEvent
1
by: sam | last post by:
I have form elements which dynamically generated like this... <form name="formA" ...> <input type="select" name="text_1" ...> <input type="select" name="text_2" ...> <input type="select"...
7
by: bonk | last post by:
Hello I am acessing a Dictionary<TKey,TValuefrom multiple threads and often in a foreach loop. While I am within one of the foreach loops the other threads must not modify the collection itself...
0
by: ajitpsingh | last post by:
Hi, I recived Error message when acessing OLE Object. "Cannot start the source application for this object" in MS Excel.
0
by: tusharkhose | last post by:
Hi, i'm creating an windows application. Here i'm using a call back to function callback() and hence i need it to be static. I want to set some form components in call back(). Please help me....
3
by: swamimeenu | last post by:
hi, I am facing the problem in vb tht if more than one user accessing my program from various systems,if both of them acessing the progam at a same time (ie) for feeding data in it ,at tht time i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.