473,408 Members | 2,734 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,408 software developers and data experts.

Opening a Form based on two sets of Criteria

129 100+
Hi, i am trying to open a form based on two ID's which are present on both forms and are numeric, i know it is probably the way i am using the "" but i have tried many different ways.

Expand|Select|Wrap|Line Numbers
  1.     Dim stDocName As String
  2.  
  3.     stDocName = "frmGrainEquations"
  4.     stLinkCriteria = ("[SubStkID] =" & Me![SubStkID] And "[CmpID] =" & Me![CmpID])
  5.  
  6. 'Testing of code writing!    
  7. '"[SubStkID] =" & Me![SubStkID] & " AND [CmpID] ='" & [CmpID] & "'
  8.  
  9.     DoCmd.OpenForm stDocName, acNormal, , stLinkCriteria
Can anyone tell me where i am going wrong please?
Aug 26 '08 #1
3 1149
hjozinovic
167 100+
Try this:
Expand|Select|Wrap|Line Numbers
  1. stLinkCriteria = ("[SubStkID] = " & Me![SubStkID] & "And [CmpID] = " & Me![CmpID])
Aug 26 '08 #2
Constantine AI
129 100+
Try this:
Expand|Select|Wrap|Line Numbers
  1. stLinkCriteria = ("[SubStkID] = " & Me![SubStkID] & "And [CmpID] = " & Me![CmpID])
Thankyou very much, it works fine now!
Aug 26 '08 #3
hjozinovic
167 100+
You're welcome Constantine.
Good job for you coming so close!
Aug 27 '08 #4

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

Similar topics

1
by: N. Graves | last post by:
Hi, I want to have a Search Dialog box that has several text box and fields to build a search and display the results in a form. I can do everything that I need to if I us a report but I would...
3
by: dskillingstad | last post by:
I'd appreciate any help I can get. I'm not sure what I'm doing wrong, but.... I've searched these groups for some solutions but no luck. I have an unbound form (frmSearch), with several unbound...
1
by: chingchanglang | last post by:
Hi, what I'm trying to do is probably very simple...but simple is relative! :D I have a cmbo box on a form "". It is populated with a query to show me all the Topics in my table where the primary...
1
by: emmaruwa | last post by:
I have a form with two text boxes (in its details section) that pull data from two fields in my database table. This same form also has a button beside the text boxes which is supposed to open...
31
by: DWolff | last post by:
I'm somewhat new to Access, and have no VB experience at all (except for modifying existing code where obvious). I built a data entry form that works fine. Typically, a client will call in and...
0
by: ChadK | last post by:
I am trying to open a report based on what the user selects on a form. Each individual criteria works but when I try to combine to pass multiple criteria it doesn't. I have read what I can find on...
5
by: RacerX2000 | last post by:
I have an MS access Database (2000) and Have created a form that sets a variable to a value I would like (Based on other selections in the form) to pass to my query criteria and I get the following...
3
by: birt | last post by:
I have a form with two subforms on it. On my 2nd subform I want to open a new form base on three criteria. One is a string two are integer. It has been over six years since I have done this and I...
6
by: martin DH | last post by:
**Urgent Need** I'll throw out the basics and any assistance is very, very, very much appreciated! Access 2003 on XP On a form (frmMain) is an option group of check boxes (ReportFrame) from...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.