Solved

Access WON'T recononize some fields when writing code

Posted on 1998-08-31
6
281 Views
Last Modified: 2011-10-03
On a form I have a command button that I'm writing code for.  What I need for this button to due is to open one table and compare it to records in a second table.  The problem I'm having and it's stumping me b/c it seems like a bug is that Access will recognize some of the fields in both tables but it won't recognize the others.  Even if just try to write code for just one of the tables it will recognize the first field in my table but none of the others???  Any ideas???

Thanks,
Kerry
0
Comment
Question by:fleiger
6 Comments
 
LVL 3

Expert Comment

by:SPECIALIST
ID: 1960795
Hi,

The only thing I can think of is how do you label your fields?

if you have field such as   Date of month   you need to reference it as [date of month].

Any fiel that has a space is required to be in brackets. also make sure they are properly referenced as recordset.

Specialist
0
 

Author Comment

by:fleiger
ID: 1960796
My fields are labeled
sName
iRoomNum
iBedNum
sSSN

ect... I'm not using any spaces in the names of my fields nor my tables, that's why I'm confused.

Thanks anyways,
Kerry
0
 
LVL 1

Expert Comment

by:mogray
ID: 1960797
fleiger,

Let's see the code you are using.


Wayne
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 3

Expert Comment

by:kaldrich
ID: 1960798
Kerry, does the format of your fields in one table match the format of the comparable field in the second table?  This may be a dumb question, but I have seen a lot of people compare dates to text.  Let me know
0
 
LVL 1

Accepted Solution

by:
st earned 100 total points
ID: 1960799
You can try these:

.
Table1.MoveFirst
Table2.MoveFirst
If StrComp(Table1("sName"), Tabel2("sName") , 0) = 0 then
.
end if
.
.

OR try these:

Table1.MoveFirst
Table2.MoveFirst
If Format(Table1("sName"))=Format(Tabel2("sName") ) then
.
end if
.
.


0
 

Author Comment

by:fleiger
ID: 1960800
The problem was actually easier than I anticipated but I'll give ya the points anyways.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question