473,569 Members | 3,043 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Copy Form1 ListBox Value to Form2 TexBox

1 New Member
Hi All,

I'm creating a Form ("Menu") that has 2 listboxs in it. My problem is that I can't copy the values of each listbox, into another Form's textboxs.

The idea is that users can select their options in the "Menu" form and then open the other form, and have those selected options copied in their respective textboxs.
I used this code from a post in this forum,
(Discussion: Copy data from one FORM to another FORM):

Me.UserName = Forms("LoginFor mName").Control s("UserName")

But i have experienced a couple of problems, mainly that it sometimes picks data that isn't the one that should go to the textbox (In both cases the value that I need is the key of the listbox), for example dates instead of numbers.

Thanks, any help is welcomed.
Feb 9 '07 #1
1 3478
NeoPa
32,564 Recognized Expert Moderator MVP
Do the users open the other form FROM this one or do they do it independently?
Which are the bound columns of the ListBoxes? Can they be changed to reflect the data you need?
(Referring to Items on a Sub-Form) should give you hints on referring to items on another form (as well as subforms obviously).
If you still have questions then come back, but try to post it more clearly with the relevant information included (names of forms; controls; columns in ListBoxes etc).
BTW if referring to another thread then the link is better to use than the title as finding a thread by title isn't too easy in a forum as busy as this.
Feb 11 '07 #2

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

Similar topics

0
1476
by: Kitchen Bin | last post by:
HELP PLEASE!! The C# Visual Studio IDE is failing to load an inherited form into the IDE from a base form when I add items to an array property of a user control on the base form. That sounds confusing but let me explain: I have a UserControl, let's call it "ButtonArrayControl", and also a separate class for holding various properties: ...
5
3786
by: nadir b | last post by:
hi I don't know how to change for exemple a form1 caption text from form2 don't forget that form2 has created from form1 I want sample code with c# *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
3
2870
by: Uma sakshi | last post by:
Hi I have one VB.NET application,in that application i have one datagrid control.The datagrid control contains somedata.I want to copy the data in a particular cell and paste it into my C#.NET application or notepad where i want to paste it to be.How can i do it?If anyone knows source code or any website URL's please let me know. ...
5
1848
by: PAPutzback | last post by:
Form2 has one purpose to open and list some names and ids. I want to handle the list box click event on form2 so I can get the selected value onto a field in form1. I changed this Dim MyForm2 As New PHfx.Form2 to With Events MyForm2 As New PHfx.Form2 and tried adding an event handler but intellisense will not show form2s objects, just...
1
1901
by: Richard | last post by:
Hello there, I have a form that is called from a Sub Main procedure using application.run(Form1). On my main form there is a button to open an instance of Form2 and then at the same time hide Form1. So far so good.
5
14150
by: John | last post by:
Hi, I can't find a simple example for a simple(?) problem. I am working on an application with a variable in form1, that variable is needed in form2 for a calculation but i can't get that variable in form2. Is there a simple method (in VSexpress2005) to get that specific variable in form2? TIA,
3
5911
by: Karan | last post by:
I am calling finalize when form2 loads and deactivates form1 which closes form1. However, same thing is not happening in form2 because finalize is already called. Does anybody has solution to it. This code works well for splash screen. I searched alot on net for codes but they don't work. for example- (1) Public Sub CloseForm(formType As...
3
2467
by: R. Harris | last post by:
Hi. I have 2 forms: form1 form2 On Form2 I have a listbox and a button. When I click the button it calls a function from form1 and within that function it updates the listbox on form2. My problem is I don't see the items added to the listbox unless I use
0
1343
by: Work007 | last post by:
Hi. I really need help on how to use a value stored in a listbox. I have a form on which it has the following code. This form allows the user to add a value to the textbox which is on this page and then takes the user to the next page: Public Class City Dim frm1 As ConfirmDestination 'Our instance of form2 Dim items As...
0
7930
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.