I'm trying to search and display an record to a form using VBA Coding. here is what i have so far. -
DoCmd. SearchForRecord acActiveDataObject, "tblIV", acFirst, patientID
-
tblIV is the name of the table i want to search in, and patientID is an integer variable that i have a value given to it in a different form that is being passed to this form (i know for a fact that the value is being passed correctly).
4 11585
I'm trying to search and display an record to a form using VBA Coding. here is what i have so far. -
DoCmd. SearchForRecord acActiveDataObject, "tblIV", acFirst, patientID
-
tblIV is the name of the table i want to search in, and patientID is an integer variable that i have a value given to it in a different form that is being passed to this form (i know for a fact that the value is being passed correctly).
You should definately benefit from reading this previous Tip of the Week: How to Find a Record Programmatically
Thanks worked like a charm!
NeoPa 32,556
Expert Mod 16PB
Have you considered simply applying a filter to the form that only allows the record you want?
This is a new command only appearing in Access 2007. It's always a good idea to include the version number when posting questions, but it's especially important when you're using this latest version, as many things are different in it and only a small subset of the members here are running it.
As for the command you're using, the code you posted has a space between DoCmd. and SearchForRecord, which it shouldn't, and you really haven't stated what problem, if any, you're experiencing, which you really should always do.
Although, as recently documented here on bytes, NeoPa's ESP is on fritz, his advice is well worth taking.
Linq ;0)> Sign in to post your reply or Sign up for a free account.
Similar topics
by: CharitiesOnline |
last post by:
Hello,
I have set this script up to add paging to a search results page. Which on
the first page works fine. I calculates how many pages there should be
depending on the number of results returned...
|
by: arikatla |
last post by:
We are using SQL Server 2000 database (with sp3) and recently we faced
an interesting issue with full text search.
According to SQLServer help page
"AND | AND NOT | OR Specifies a logical...
|
by: Steph |
last post by:
Hi.
I'm very new to MS Access and have been presented with an Access database
of contacts by my employer.
I am trying to redesign the main form of the database so that a button
entitled...
|
by: John |
last post by:
hi,
i have created a search form, and i want to search for a specific item in a
field.
e.g. i have a field called colour, which has record1 = 'red, blue, green'
and another record2 = 'red'
...
|
by: Arsalan Ahmad |
last post by:
Hi,
May be I am a newbie, or may be i dont have that much insight in following
systems ..i.e. why i have some confusions as below:
In many websites, when search is performed on some keywords...
|
by: dio_mack |
last post by:
MINIMIZE RISK BY CONFIRMING IDENTITY OF INDIVIDUALS
Obtain the confidence you need to move forward quickly and accurately in business, institutional and personal matters with a full-spectrum check-...
|
by: vonclausowitz |
last post by:
Hi All,
I was thinking of creating a table in my database to index all words in
the database.
That way I can quickly search for one or more words and the index table
will return the
words and...
|
by: suek |
last post by:
I have a table with over 4000 records to search upon, and the users
don't like a combo box.
So what I have been trying to do for the last twelve hours is do some
code to get a text box to search. ...
|
by: Redbeard |
last post by:
Hi All this is my first time post, be gentle.
I am looking at creating a keyword search that searches multiple fields in a Form and then filters records that match the keyword. The Form...
|
by: jfarthing |
last post by:
Hi everyone!
I am using the script below to search a db. If the is more than one match in the db, all goes well. But if there is only one match in the db, nothing gets displayed.
Any...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
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...
| |