Hi all I need some help.
I'm working on a project where i need to move on some records depending the value that the user chooses from a list box.I use the DoCmd.GoToRecord Like this:
"DoCmd.GoToRecord acDataForm, "ADV_FORM", acGoTo, LIST.Value"
Where LIST.Value is the primery key of a table and that's Auto Number.
The problem is that if the key has the value 8,the current record will be the 8th and not the record that has 8 as key (The numbering has gaps 1-2-4-7-8...etc)
What i want is to move to the current record to the one that has the specified key.The help file talks about expression as a fourth argument of the DoCmd so I tried:
"DoCmd.GoToRecord acDataForm, "ADV_FORM", acGoTo, [ADV]![code]=8"
But didn't worked.Is there a way to do that whith DoCmd.GoToRecord,or should I try SQL?(I will be needing help with this too..)
Thanks for any help
3 58929
Hi all I need some help.
I'm working on a project where i need to move on some records depending the value that the user chooses from a list box.I use the DoCmd.GoToRecord Like this:
"DoCmd.GoToRecord acDataForm, "ADV_FORM", acGoTo, LIST.Value"
Where LIST.Value is the primery key of a table and that's Auto Number.
The problem is that if the key has the value 8,the current record will be the 8th and not the record that has 8 as key (The numbering has gaps 1-2-4-7-8...etc)
What i want is to move to the current record to the one that has the specified key.The help file talks about expression as a fourth argument of the DoCmd so I tried:
"DoCmd.GoToRecord acDataForm, "ADV_FORM", acGoTo, [ADV]![code]=8"
But didn't worked.Is there a way to do that whith DoCmd.GoToRecord,or should I try SQL?(I will be needing help with this too..)
Thanks for any help
Try using the DoCmd.FindRecord, which allows you to use the keyvalue as the search key.
see this link for an explanation and example syntax: http://www.blueclaw-db.com/docmd_findrecord_example.htm
I've tried the DoCmd.FindRecord but nothing huppents.Actually what i get from the debuging is that DoCmd.FindRecord don't make the record which i want as the current record.Am i doing something rong?
DoCmd.FindRecord makes the record that looks for current or not?The help file isn't helpfull at all...
I've tried the DoCmd.FindRecord but nothing huppents.Actually what i get from the debuging is that DoCmd.FindRecord don't make the record which i want as the current record.Am i doing something rong?
DoCmd.FindRecord makes the record that looks for current or not?The help file isn't helpfull at all...
The default findRecord command will return the record you want if there is a match to the field that currently has focus, Consequently, you need to set focus on the field that you want to search before you execute the FindFirst as shown below: -
Me.List.SetFocus ' set focus on the field to be searched
-
DoCmd.FindRecord List.value , , False , , True , , False
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Hugh G. Johnson |
last post by:
I have a knowledgebase (KB) system I installed into my existing dynamicly
driven site. I used iFrame to grab the KB and place it in the content area
of the page. This works great, but I realize now...
|
by: Simone |
last post by:
Hello!!!
Here is the thing.
I have had this problem and I want to address it now where in the next
and previous button DoCmd.GoToRecord , , acNext - DoCmd.GoToRecord , ,
acPrevious I wish the...
|
by: Regnab |
last post by:
The record's primary key is the report number. The form in which data
is entered or modified has this Report Number at the top. I would like
to know if I could use SQL in the VB code so that on...
|
by: ApexData |
last post by:
Hello
How do I goto a specific record in a BOUND form when the form has a
primary
index of ID which is autonumbered. I need to visit 4 seperate records,
one at a time.
This works for RecNO...
|
by: nkoske |
last post by:
I have a form with a subform in datasheet view and I have a event on
one of the fields in the subform, so that the user can double click it
and go to expanded information based on that field.
...
|
by: cmp80 |
last post by:
I have a database that I am using to store student data. There are two tables and two forms to display the data:
Tables
tbStudent
tbRE
Forms
fmStudent
fmRE
|
by: eighthman11 |
last post by:
Using Access 2000. I have a continuous form which for simplicity sack
has two fields Social Security Number and Last Name.
In the header of the continuous form I have a textbox where you can...
|
by: cvillav |
last post by:
Hello, I am new to Access and this forums,
I have two tables and two forms to display the data.
Tables
Tbuilding
Tcriteria
Forms
fmbuilding
|
by: JoeKid09 |
last post by:
Hi All,
Good morning! I am working on a form that is bound to a table with user’s name. I need to be able to go to specific record base on a text box value which contain user login name, if there...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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: 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...
|
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...
|
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,...
|
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...
| |