Hi,
I have two forms with the the same ID field (ProjID) in each
Form1:
[Forms]![F_ClientDetails]![SF_Session].[Form]![ProjID]
Form2:
[Forms]![F_Project]![ProjID]
I have Form 1 open and i want to be able to open form two and navigate automatically to the relevant record determined by the ProjID field in form 1
So for example form 1 will have the ProjID fiels value as 10 when i open form2 i want it to automatically find the record that has 10 as the ProjID value.
hope this makes sense
please help
Regards Phill
5 1474
Hi,
Its ok i found the answer
DoCmd.OpenForm "F_artistproj", , , "[ProjBandID] = " & Me.Combo101
Thanks anyway
Make note, Phill, for future reference, that your syntax is only good when the ID field is a Numeric field. Here's the general syntax for Numeric, Text and Date fields.
If ProjectID is Numeric DataType: - DoCmd.OpenForm "Form2", , , "ProjectID = " & Me.ProjectID
If ProjectID is Text DataType: - DoCmd.OpenForm "Form2", , , "ProjectID = '" & Me.ProjectID & "'"
If ProjectID is Date/Time Datatype: - DoCmd.OpenForm "Form2", , , "ProjectDate = #" & Me.ProjectDate & "#"
Linq ;0)> NeoPa 32,556
Expert Mod 16PB
Am I right to guess that you are actually talking about A being a subform of B in this case?
This completely changes the question of course (such that your solution, though it may work, would be a kludgy work-around rather than a good solution).
Hi Linq
Thanks for that, it has solved the problem to an extent....
I am able to open the relevant record in the 2nd form but for some reason it only displays that record.
So for example i have three records in the underlying table
Record 1
Record 2
Record 3
I want to be automatically taken to record 2 but i still want to have the option to be able to scroll through all three records at the moment i can only see record that is being displayed in form 1 even though there are three records in the underlying table.
Regards Phill
Well, Phill, you really need to state your complete needs in your initial post, so that people don't waste time giving you answers that won't work for you. To do this you need to use code like this, using the OpenArgs argument of the DoCmd.OpenForm command:
In your calling form: - DoCmd.OpenForm "Form2", , , , , , Me.ProjectID
Then, in Form2, where ProjectID holds the field you're using: - Private Sub Form_Load()
-
If Len(Nz(Me.OpenArgs, "")) > 0 Then
-
ProjectID.SetFocus
-
DoCmd.FindRecord Me.OpenArgs
-
End If
-
End Sub
Linq ;0)> Sign in to post your reply or Sign up for a free account.
Similar topics
by: G Kannan |
last post by:
Hey all!
I have written a perl script to retrieve information from a HTML Form
and insert the data into an Oracle database table. I am gettting the
the following error message:
"Use of...
|
by: Hodad |
last post by:
I would like to adapt, as much as possible, the appearance and color red
of the
font in this button:
<P><CENTER><BUTTON VALUE="SUBMIT"><A...
|
by: Roberto Castro |
last post by:
Hello!
I have been assigned for the first time an adp Access project and so
far I have managed to make the changes needed for some requirements.
However, I am struggling to find the place where...
|
by: Alienz |
last post by:
Hey all. if anyone is REALLY bored please help moi. I am new to
access stuff and am probably missing something obvious here.
I have 2 tables that are linked via "number" in the relationship...
|
by: AA Arens |
last post by:
I use the undermentioned code to find a record in a predefined "Look
In" field:
Private Sub Command137_Click()
On Error GoTo Err_Find_Record_Click
Me.CompanyName.SetFocus
DoCmd.DoMenuItem...
|
by: jason |
last post by:
Playing around with asp.net 2.0 and asp:menu for the first time..
what's the attribute/code so that each item in my menu has a *SEPERATE*
border around it? Seems I can only make the border around...
|
by: Chris Curvey |
last post by:
I have a form like this, which looks like a grid of entries.
<form method="get" action="/dosomething>
<table>
<tr>
<td><input type="text" name="foo" value="1"></td>
<td><input type="text"...
|
by: sparks |
last post by:
Right now I had to build a report that allowed the people to check for
gross outliers in their data input.
short I am looking at 2.5* std dev + -
anyway I used 2 dummy variables in the query the...
|
by: Desitech |
last post by:
I have a table that has a field where I use the look-up from another table's field. When I put this into a form or report. It returns an integer in the field rather that the value (text) from the...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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: 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...
|
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: 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,...
|
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,...
| |