473,385 Members | 1,309 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.

Pass value from 1 form to another

I have 2 access forms,
In 1st form I am displaying reportname from my table
then I will select one record from 1st form and will press next button
now I want to display this reportname onto next 2nd form in a text box
but its not working

my code
Expand|Select|Wrap|Line Numbers
  1. Private Sub EditReport_CB_Click()
  2. On Error GoTo Err_EditReport_CB_Click
  3. Dim DB As Database
  4. Dim Rnv1 As String
  5. Dim strSQL As String
  6. Dim frm1 As New Form_F_reportWizard1
  7. Dim frm21 As New Form_F_reportWizard21 
  8.  
  9. Rnv1 = Me.REPORT_NAME_CB.Value 
  10.  
  11. frm21.SetFocus
  12. frm21.ReportName_TB.SetFocus
  13. frm21.ReportName_TB.Text = Rnv1 'here it shows the correct reportname  
  14.  
  15. Dim stDocName1 As String
  16.  
  17. stDocName1 = "F_ReportWizard1"
  18. DoCmd.Close acForm, stDocName1
  19.  
  20.  
  21. Exit_EditReport_CB_Click:
  22. Exit Sub 'but after this line form 2 closed and no values are available.please help!!!
  23. Err_EditReport_CB_Click:
  24. MsgBox Err.Description
  25. Resume Exit_EditReport_CB_Click
  26. End Sub
Sep 21 '07 #1
1 1603
NeoPa
32,556 Expert Mod 16PB
Check out Referring to Items on a Sub-Form. It includes how to reference forms from anywhere really. You can refer to form1 from form2 if you need to.
Sep 21 '07 #2

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

Similar topics

1
by: vishal | last post by:
hi i am using get method to pass data from one form to another and my value may contain & symbol. so when this is case the value after & sign is truncated which is logically true. so what...
4
by: Fred | last post by:
Hi, i know how to pass a value from Javascript to ASP with a hidden field into a form and submitting it, or with cookies, but here i have to pass a lot of data in an array. There is a list of...
11
by: Vanessa | last post by:
Hi, I would like to know whether there's any way for me to pass an object by reference to another form? Regards Vanessa
1
by: carmen | last post by:
I am using the code below to open another page depending on what is selected. This is working ok but I would like to streamline it so that I will hot have to create a page everytime a new category...
3
by: Lyn | last post by:
Hi, I have been experiencing a problem passing a LIKE statement in the WHERE argument of a DoCmd.Openform statement. I have posted that issue separately. However, in an attempt to work around...
4
by: tom | last post by:
Hi Experts, I want to pass the selectedDate value from my calender form to another web form or a web user control. Could you please show me how to do this? Thanks in advance.
2
by: c676228 | last post by:
Hi, This is my first time to post asp.net question on this forum. I have a question for "How to pass the first form value to the next form" I have enrollinfo.aspx form which look like as follow:...
17
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the...
2
by: Rudy | last post by:
Hello All! I have been trying to figure this out, have recieved alot of help, but it's just not clicking in the ol' noggin. I basicly have a value in a text box, I need to keep that value and...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.