473,382 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,382 software developers and data experts.

Ms Access-Dlookup next record

Hello,

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.
AND
b). Who all are having date of birth as "10-JAN-2000" in the 7th standard class
AND
c). Who all are having grade as "Distinction" 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.

ngr.
Jun 22 '09 #1
0 2669

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

Similar topics

63
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...
13
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....
1
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...
13
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...
47
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...
92
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...
0
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...
1
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. ......
17
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...
37
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...
1
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
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,...
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:
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...
0
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
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: 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...

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.