473,701 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ms Access-Dlookup next record

41 New Member

I have few problem with Dlookup condition. I need to retrieve next record or previous record based on certain condition. The conditions are set in in the combo box. Here, I am trying to display the records in the text box based on my selection. I have given my selection in the combo box.

For example from the student table, I am trying to display as below...

a). Who are all coming from "Newyork" city in the 7th standard class.
b). Who all are having date of birth as "10-JAN-2000" in the 7th standard class
c). Who all are having grade as "Distinctio n" in the 7th standard class

The fields are City,DtofBirth, Grade in the student table. All these THREE fields are listed each in combo boxes. When i select each combox box, the respective records should display in the text boxes. Assume that there are 10 row in the form. The each row contains 5 text boxes namely Stud_Name,Stud_ Eno, Stud_City,Stud_ DOB & Stud_Grade.

I have used below Dlookup function in the text box. Assume that the fields types are number.

To retrieve the first record
=DLookUp("[Stud_Name]","Stud_Tbl ","[Stud_City]=" & [City] & "And [Stud_DOB]=" & [DOB] & "And [Stud_Grade]=" & [Grade])

To retrieve the next record
=DLookUp("[Stud_Name]","Stud_Tbl ","[Stud_City]=" & [City] & "And [Stud_DOB]=" & [DOB] & "And [Stud_Grade]=" & [Grade] +1)

(Added +2,+3 etc., for the next records in the rest of text boxes.)

The problems are..
a). The first problem is that it display the records irrelevantly for few condition, like when i change the city from "Newyork to Texas" it shows irrelevant records.

b). The 2nd record doesn't display in the next text box. It display in the 3rd text box. The 2nd textbox is showing empty.

c). When the form load, the text boxes shows "#Error" as no values selected in the combo boxes - How can I avoid this error message.

What is the problem over here..? ..Is there anything wrong in the way i try to display the records. Is there anyother way to do like this...?

I guess since the records are stored randomly it gives the problem. But, no other way as the record will be stores always random only.

I have spent more time for this. But, not able to find out the solutions.

I WOULD BE VERY HAPPY if anyone helps me to find solutions.

Your solution would be HIGHLY APPRECIATED.

Thanks in advance.

Jun 22 '09 #1
0 2705

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

Similar topics

by: Jerome | last post by:
Hi, I'm a bit confused ... when would I rather write an database application using MS Access and Visual Basic and when (and why) would I rather write it using Visual Studio .Net? Is it as easy in Visual Studio to create reports and labels as it's in Access?` The advantage of VS.net is that not every user needs Access, right? And that would eliminate the Access version problem as well I guess.
by: bill | last post by:
I am trying to convince a client that dotNet is preferable to an Access project (ADP/ADE). This client currently has a large, pure Access MDB solution with 30+ users, which needs to be upgraded. I believe a dotNet solution is better, but I'm trying to be as convincing as possible -- and maybe I'm wrong! I would appreciate any input or references which could help me.
by: Dave | last post by:
Hello NG, Regarding access-declarations and member using-declarations as used to change the access level of an inherited base member... Two things need to be considered when determining an inherited base member's access level in the derived class: its access level in the base class and the type of inheritance (public, protected, or private). After this determination is made, the following possibilities exist for manually changing the...
by: Simon Bailey | last post by:
I am a newcomer to databases and am not sure which DBMS to use. I have a very simplified knowledge of databases overall. I would very much appreciate a (simplifed) message explaining the advantages and disadvantages of both programs. Many Thanks Simon
by: ship | last post by:
Hi We need some advice: We are thinking of upgrading our Access database from Access 2000 to Access 2004. How stable is MS Office 2003? (particularly Access 2003). We are just a small company and this is a big decision for us(!) It's not just the money it's committing to an new version of Access!
by: Jeffrey P via AccessMonster.com | last post by:
Our IT guys are on a vendetta against MS Access (and Lotus Notes but they've won that fight). What I can't understand is, what's the problem? Why does IT hate MS Access so much. I have tried to find out who it is that actually wants to get rid of it, but I can't find anyone who will admit to trying to get rid of it. Nevertheless, I'm always hearing about how their "phasing it out" or "getting rid of it". Because no-one owns up I can't...
by: com | last post by:
MS Access 2000 Password Recoverer 4.2 Screenshot - Soft30.com MS Access 2000 Password Recoverer will display the password to a MS Access database (*.mdb). This program works for MS Access files saved in MS Access 2000. ... www.soft30.com/screen-149-12232.htm - 32k - Cached - Similar pages MS Access HTML Help Generator 1.2 - Soft.com MS Access HTML Help Generator 1.2. ... System Requirements: MS Access 2000 / XP /
by: com | last post by:
Extreme Web Reports 2005 - Soft30.com The wizard scans the specified MS Access database and records information such as report names, parameters and subqueries. ... www.soft30.com/download-1-11975.htm - 31k - Cached - Similar pages MDBSecure - Soft30.com Utility which makes it easy to create secure MS Access Databases, ... MS Access 2000/2003 format. 30 day money back guarantee, 30 day trial. ...
by: Mell via AccessMonster.com | last post by:
Is there a way to find out where an application was created from? i.e. - work or home i.e. - if application sits on a (work) server/network, the IT people know the application is sitting there, but is there a way they can find out if that application was put there from a CD or email or created at work? Hint: It's not on a client/server database, just native jet database mdb created on Access 2003 (default 2000)...
by: jasmith | last post by:
How will Access fair in a year? Two years? .... The new version of Access seems to service non programmers as a wizard interface to quickly create databases via a fancy wizard. Furthermore, why would you even continue to use Access as a backend when you have a much superior option in SQL express? What about as a future front-end development tool? Let's get serious. Microsoft continues to publish numerous articles and videos on how you...
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...
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,...
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...
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...
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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.