473,385 Members | 1,343 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,385 software developers and data experts.

greet user HELP

Hi there!

I'm new in coding a vb in ms access and I seemed to be lost.
my problem is I want to pass a value from FormA to FormB using a textbox, cmdButton and label control I seemed to get an error in access 2000.

hereis the code:
in Form A I have a txtLogin and I put this code in the Control Source:
=[FormA].[Forms]![lblName].[Caption]

then on FormB I have a lblName and I put this code:
=[FormB].[Forms]![txtLogin].[Value]

when the cmdButton is clicked the value of the txtLogin will be transfered to
lblName. unfortunately I'm missing something here :( can somebody help me and show me how to work on this functions!
thanks!
Jan 30 '08 #1
3 1458
Jim Doherty
897 Expert 512MB
Hi there!

I'm new in coding a vb in ms access and I seemed to be lost.
my problem is I want to pass a value from FormA to FormB using a textbox, cmdButton and label control I seemed to get an error in access 2000.

hereis the code:
in Form A I have a txtLogin and I put this code in the Control Source:
=[FormA].[Forms]![lblName].[Caption]

then on FormB I have a lblName and I put this code:
=[FormB].[Forms]![txtLogin].[Value]

when the cmdButton is clicked the value of the txtLogin will be transfered to
lblName. unfortunately I'm missing something here :( can somebody help me and show me how to work on this functions!
thanks!
You cannot place =[FormB].[Forms]![txtLogin].[Value] into a label you have to set the labels caption property

in the code for the command button in formA after the codeline that opens your formB type this line and provided our form B opens successfully the caption will be set by reference to the value of the txtLogin control on FormA

Expand|Select|Wrap|Line Numbers
  1.  Forms!FormB!lblName.caption=Forms!FormA!txtLogin
Look closely how you refer to the hierarchy of controls in Access starting at form level ie Forms!MyForm!MyControl shows a kind of snakepath if you understand me from the form to the eventual control

Expand|Select|Wrap|Line Numbers
  1.  Forms!FormName!SubformName.Form!ControlNameOnMySubform
  2.  
snakes right down to the control on a subform mounted on a form and so it goes on (remove any gap in the last code line above my post refuses to format it properly :(

Hopes his helps you a little and welcome to 'both' vba coding and the scripts!

Regards

Jim :)
Jan 30 '08 #2
Thank you Jim! for helping me and clearing it out for me, the code really helps.
I'll keep in mind about what you suggested and practice on it more.
Jan 30 '08 #3
Jim Doherty
897 Expert 512MB
Thank you Jim! for helping me and clearing it out for me, the code really helps.
I'll keep in mind about what you suggested and practice on it more.
Glad to be of help to you

Jim :)
Jan 30 '08 #4

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

Similar topics

5
by: MLH | last post by:
I'm supposed to set a password for the MySQL root user. The output of mysql_install_db instructed me to run the following commands... /usr/bin/mysqladmin -u root -h appserver password mynwewpasswd...
11
by: Marcelo López | last post by:
I need to create a folder in the file system owned by an special user created by my application. The idea is that only my app will have permissions to delete and create files on that folder. My...
6
by: Leo_Surf | last post by:
Hello, I need your help adding user in Active Directory from ASP.net website. Could any one provide me the complete code for the html page. As this is my curriculam project and I dont have any...
0
by: rushinblue | last post by:
Hi everyone, I am very new to ASP. I want a simple Good morning, First Name (DisplayName) to be displayed from Active Directory. All I have seen online is AD authentication with forms. Any help or...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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...

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.