I have no exactly idea how to pass a variable value from one form to another, How do I do it using, say in Form 1 using DoCmd.OpenForm like the below statement, correct me If I am wrong.
FORM_1
Dim msg As String
strlsql = "Hello"
DoCmd.OpenForm "frmPO", acViewNormal, , msg
Then on the 2nd Form -FORM_2, Should I detect it from the Form_load ? .
FORM_2 (Form_Load)
IF msg = 'bla bla" then
do this ...........................
Endif
2 3908
You use the last argument of the OpenForm command, openargs. strMessage is assigned to openargs in Form1, then retieved in Form2 - 'On the first form
-
Private Sub Goto2ndForm_Click()
-
Dim strMessage as String
-
strMessage = "bla bla"
-
DoCmd.OpenForm "2ndForm", , , , , , strMessage
-
End Sub
-
-
'On the second form
-
Private Sub Form_Load()
-
If OpenArgs = "bla bla" Then
-
'Do whatever
-
End If
-
End Sub
You use the last argument of the OpenForm command, openargs. strMessage is assigned to openargs in Form1, then retieved in Form2 - 'On the first form
-
Private Sub Goto2ndForm_Click()
-
Dim strMessage as String
-
strMessage = "bla bla"
-
DoCmd.OpenForm "2ndForm", , , , , , strMessage
-
End Sub
-
-
'On the second form
-
Private Sub Form_Load()
-
If OpenArgs = "bla bla" Then
-
'Do whatever
-
End If
-
End Sub
Thanks so much, got your message, it working now.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Seeker |
last post by:
Newbie question here...
I have a form with some radio buttons. To verify that at least one of the
buttons was chosen I use the following code ("f" is my form object) :
var btnChosen;
for...
|
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...
|
by: Mr A |
last post by:
Hi!
I've been thinking about passing parameteras using references instead
of pointers in order to emphasize that the parameter must be an
object.
Exemple:
void func(Objec& object); //object...
|
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...
|
by: Martin |
last post by:
I have a calendar form that sends the inputted date back to a text box .
Using the GET method, I would like to pass the date as a variable to another
asp page. How do I do this?
Thanks.
|
by: drec |
last post by:
I need to pass a variable from script1.php to script2.php. The problem
is that these scripts use frames and therefore I am able to pass the
variable through the URL. It also does not use forms to...
|
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...
|
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....
|
by: JRough |
last post by:
I tried to pass the $result from a mysql_query in a url like this line
Header("Location:clm_historyXL.php?_result=".$result);
but on the redirect location clm_history.php page I get an error on...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
| |