473,750 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_FejlRecordsCl aims and find the record stDocName
= "F_FejlRecordsC laims"
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 2472
<bj**@vestas.co m> 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_FejlRecordsCl aims and find the record stDocName
= "F_FejlRecordsC laims"
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.co m> 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
16739
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 (for the user to verify) if I don't know what the primary key was when it was inserted? Is the only way to not use autoincrement and choose the primary key value myself?
2
1709
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 system will be to track when it is time to follow up with a customer. Sometimes it's for a specific reason, other times it's just a routine "keep in touch" contact.
2
1847
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 indexes are less that complete!. This is also the first real application iI have developed for Access, although I have done a number in Lotus Approach. I have a table with information on how an Associate is to be handled under a specific Purchase...
3
5218
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 memo will look something like this: Order: J123451 Placed By: Joe.systems,daily Order: J123452
2
3167
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) ..Fields.Append .CreateField(strTmpIDFld, dbLong) ..Fields.Append .CreateField(strTmpDateFld, dbDate) ..Fields.Append .CreateField(strTmpDataFld, dbDouble)
2
1212
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
5322
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 (ado.net) program. I am able to Navigate through the dataset ie: MoveNext, MoveFirst, MovePrev, MoveLast by just keeping track of my record position. I can Add,Delete,Update Records etc by using the CommandBuilder ie: Dim cb As New...
7
79842
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 generic Find process. Private Sub cboFind_AfterUpdate() Application.Echo False Me!.SetFocus DoCmd.FindRecord cboFind cboFind.SetFocus
4
1646
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 anyone help me with this ? i have a pages with html and table all scatter there..now i want just specific table from the page and all records in that page, i was successfull somehow but still have problems ,here are they..
0
8999
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8836
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9575
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8260
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4885
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2223
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.