Solved

Access WON'T recononize some fields when writing code

Posted on 1998-08-31
6
276 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
Comment Utility
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
Comment Utility
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
Comment Utility
fleiger,

Let's see the code you are using.


Wayne
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 3

Expert Comment

by:kaldrich
Comment Utility
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
Comment Utility
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
Comment Utility
The problem was actually easier than I anticipated but I'll give ya the points anyways.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now