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

look up a value on a form

121 100+
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
Jan 13 '09 #1
5 1474
phill86
121 100+
Hi,

Its ok i found the answer

DoCmd.OpenForm "F_artistproj", , , "[ProjBandID] = " & Me.Combo101

Thanks anyway
Jan 13 '09 #2
missinglinq
3,532 Expert 2GB
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:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "Form2", , , "ProjectID = " & Me.ProjectID
If ProjectID is Text DataType:
Expand|Select|Wrap|Line Numbers
  1.  DoCmd.OpenForm "Form2", , , "ProjectID = '" & Me.ProjectID & "'"
If ProjectID is Date/Time Datatype:
Expand|Select|Wrap|Line Numbers
  1.  DoCmd.OpenForm "Form2", , , "ProjectDate = #" & Me.ProjectDate & "#"
Linq ;0)>
Jan 13 '09 #3
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).
Jan 13 '09 #4
phill86
121 100+
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
Jan 13 '09 #5
missinglinq
3,532 Expert 2GB
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:

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm "Form2", , , , , , Me.ProjectID
Then, in Form2, where ProjectID holds the field you're using:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.      If Len(Nz(Me.OpenArgs, "")) > 0 Then
  3.        ProjectID.SetFocus
  4.        DoCmd.FindRecord Me.OpenArgs
  5.    End If
  6. End Sub
Linq ;0)>
Jan 13 '09 #6

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

Similar topics

1
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...
3
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...
3
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...
0
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...
1
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...
0
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...
1
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"...
9
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...
2
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...
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: 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
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
marktang
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,...
0
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,...

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.