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

Finding a specific record

Hi

I got a form where I type a number.
After taht I split it in two.
Then I search in a table if there are any record that match the two
numbers and not yet been completed.
The code:

VareVar = Left(Me!VareNr, 8)
MyLen = Len(Me!VareNr) - 8
SerialNoVar = Right(Me!VareNr, MyLen)
DatoAfslVar = #12:00:00 AM#
FoundVar = True
'Is there a not-completed registration on this VareVar and
serialNoVar ?
If Not IsNull(VareVar = DLookup("VareNr", "T_FejlRecords",
"[VareNr] = '" & VareVar & "'" _
& "And [SerieNr] = '" & SerialNoVar
& "'" _
& "And [DatoAfsl] = #" &
DatoAfslVar & "#")) Then

'close F_Indtast varennr
DoCmd.Close
'open F_FejlRecordsClaims and find the record stDocName
= "F_FejlRecordsClaims"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Now I want to find the specific record that contain the tree criteria:
1. VareVar in the field "VareNr"
2. SerialNoVAR in the field "SerieNr"
3. DatoAfslVar in the field "DatoAfsl"

Hope someone can help me.

Best regards
Ronald

Nov 13 '05 #1
3 2450
<bj**@vestas.com> wrote
I got a form where I type a number.
After taht I split it in two.
Then I search in a table if there are any record that match the two
numbers and not yet been completed.
The code:

VareVar = Left(Me!VareNr, 8)
MyLen = Len(Me!VareNr) - 8
SerialNoVar = Right(Me!VareNr, MyLen)
DatoAfslVar = #12:00:00 AM#
FoundVar = True
'Is there a not-completed registration on this VareVar and
serialNoVar ?
If Not IsNull(VareVar = DLookup("VareNr", "T_FejlRecords",
"[VareNr] = '" & VareVar & "'" _
& "And [SerieNr] = '" & SerialNoVar
& "'" _
& "And [DatoAfsl] = #" &
DatoAfslVar & "#")) Then

'close F_Indtast varennr
DoCmd.Close
'open F_FejlRecordsClaims and find the record stDocName
= "F_FejlRecordsClaims"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Now I want to find the specific record that contain the tree criteria:
1. VareVar in the field "VareNr"
2. SerialNoVAR in the field "SerieNr"
3. DatoAfslVar in the field "DatoAfsl"


Read Help on the DoCmd.OpenForm WhereCondition argument, shown in your code
as "stLinkCriteria", and construct the "WHERE clause without a WHERE", as
follows:

stLinkCriteria = "[VareNr]=""" & VareVar &_
""" And [SerieNr] = """ & SerialNoVAR &_
""" And [DatoAfsl] = #" & DatoAflsVar & "#"

My assumption here is that VareVar and SerialNoVAR are variant variables
containing text strings and that DatoAflsVar is a variant variable containg
a Date.
Nov 13 '05 #2
Thank you. That was just what I needed.

Ronald

Nov 13 '05 #3

<bj**@vestas.com> wrote

Thank you. That was just what I needed.


You are welcome.
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Gabriel Harrison | last post by:
Hi, I have a mysql db with with autoincrementing primary keys in each table. I want to allow a user to add a record using a php webpage. Once the page is added how can I re SELECT that record...
2
by: Paul | last post by:
Hi, I'm developing a CRM (Customer Relationship Management) system in MS Access. I have 2 tables. The first is a customer master file, the second is an activity file. A key function of the...
2
by: John Baker | last post by:
Hi: I have used this group a number of times simply because while the manuals for Access may show the technology, but most are really weak on how to apply it in special situations and the...
3
by: Helgardh | last post by:
I have a linked table (Access 2003) to an Outlook inbox. The body of the e-mail messages are in a memo field. My problem is that I need to "read" the memo and find data on certain lines. The...
2
by: rivka.howley | last post by:
I wrote some code that creates a table with a date/time field at 15-minute intervals. Here's how I create and populate the table With tblDataTemp ..Fields.Append .CreateField("CT_ID", dbLong)...
2
by: Mark Vergara | last post by:
Hi! Is there any way of finding of what position in a particular record ? For example I have 3 records 1 Record 1.. 2 Record 2.. 3 Record 3..
3
by: Newbie | last post by:
Could someone please tell me how or if the following is possible. I have created a small test database and have opened one connection, one DataAdapter, and one Dataset for it in my vb.net...
7
ADezii
by: ADezii | last post by:
Use the FindRecord Method of the DoCmd Object (least efficient) - The simplest approach for finding a specific Record is to create an Event Procedure for the Combo Box that mirrors each step of the...
4
by: Hardik Dangar | last post by:
hi friends, i have a bunch of html pages and i want to fetch records from them and i m really confused how i can do after working with regular expressions and other stuffs from last few days can...
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:
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
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:
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...
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
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,...

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.