473,408 Members | 1,746 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,408 software developers and data experts.

Get 1 field from 1 row Access 2007 VBA

SBCUser666
This is driving me crazy. I want 1 field from the first row of a table.

SELECT TOP 1 fielda FROM mytable



Every row in the table will have the same value in fielda. I just want to check to see if the value is correct. I really don't want to have to process a record set for 1 field.



Is there a way to do an in-line query for 1 row and how do I later reference the data returned?
Sep 8 '09 #1

✓ answered by NeoPa

If you simply want the value of one field from one record of a table then DLookup() will give you that.

In your case I doubt you'll need any criteria.

I won't go into asking about why you would have the same data in each record of a table. Sounds de-normalised to me (that's not a good thing). See Normalisation and Table structures.

3 3704
NeoPa
32,556 Expert Mod 16PB
If you simply want the value of one field from one record of a table then DLookup() will give you that.

In your case I doubt you'll need any criteria.

I won't go into asking about why you would have the same data in each record of a table. Sounds de-normalised to me (that's not a good thing). See Normalisation and Table structures.
Sep 8 '09 #2
DLookup with no criteria worked great. Thanks!

I am just trying to automate a very manual process that uses 3 Oracle queries to extract data, import 3 CSV files into Access, 3 Access queries to update internal tables and then 3 Access queries to update 3 tables linked to a SQL database.

I am not about to normalize any of this.
Sep 8 '09 #3
NeoPa
32,556 Expert Mod 16PB
@SBCUser666
You have to make the call of course. There are situations where normalising, especially retrospectively, is not worth the effort. They're pretty rare IMHO, but you're on the spot, so only you can make the call ultimately.
Sep 9 '09 #4

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

Similar topics

3
by: Roy | last post by:
Hi All, I have a table in A2K application.I get a memo field via download from a .csv file.The contents are as below: field name is TicketStatus, For example,a single ticket,TicketID 12345 ...
1
by: Roy | last post by:
I have a table with two fields. I wish to separate all the data in one field and keep it listed against the information in the other field. The information within the field TicketStatus, I wish to...
2
by: ACF | last post by:
Hello, I’m trying to format only selected text in an RTF Memo field in Access 2007 I’m able to copy selected text in a Memo field to the Windows clipboard with following code: ...
3
by: scott | last post by:
Is it possible to place multiple fonts into one field of an access report? What I need to do is place some text which is in a specific font (used by nurseries to show of a unique species of plant)...
1
by: bloukopkoggelmander | last post by:
Hi all I have a bit of a strange problem where I want to set a table field in Access 2007 to an attachment field, but when I follow the Microsoft workmethod, I get no option in Access for...
7
by: ARC | last post by:
This is taken from the "What's New in Access 2007" page. However, I've looked through all the properties of a text field memo box, and cannot find the append only option. Does anyone know how to...
5
by: Bubo.virginianus | last post by:
Heya! I feel I'm beating an old horse to death with this question but I can't get around the problem. I want to update a text field on a form with a string from a VB module. I need...
4
by: TD | last post by:
I am trying to change the forecolor of a field in a subform that is in datasheet view. I am using Access 2007. I have tried everything I can think of to do this but the text still appears in...
25
by: Rick Collard | last post by:
Using DAO 3.6 on an Access 2002 database, I'm getting unexpected results with the FindFirst method. Here's the simple code to test: Public Sub FindIt() Dim db As Database, rs As Recordset...
1
by: Mientje | last post by:
I've made an Access 2007 database to store information about the lessonplans I have to make every schoolyear. I want to export the data form the table "Lesvoorbereiding" (Lessonplans in English) to...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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...
0
jinu1996
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...
0
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...
0
isladogs
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...
0
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...

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.