Solved

Access WON'T recononize some fields when writing code

Posted on 1998-08-31
6
284 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

688 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