473,609 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Does Access have a mind of its own?

DFS
I swear that sometimes things behave differently from one day to the next.
Access 2003.

Example: I have 4 radio buttons that set the rowsource of a combobox
depending on which option you choose. One of the 4 options has a text field
as the first column in the rowsource, and the other 3 are numbers. The
combobox has no formatting set.

Using the text option sometimes returns:

'The value you entered isn't valid for this field. For example, you may
have entered text in a numeric field...blah blah'

So then I choose one of the number options, then go back to the text option
and voila! it's fine.

Nov 13 '05 #1
6 2064
DFS wrote:
'The value you entered isn't valid for this field. For example, you may
have entered text in a numeric field...blah blah'

So then I choose one of the number options, then go back to the text option
and voila! it's fine.


I would say it has to do with how the combo box row source is specified,
if not blank, on opening the form and/or with how you construct the SQL
for the row source after your radio button option group is updated.
I've run into this sort of thing in the past and I had to be consistent
in how I defined data types for the SQL statement. Remember that
everything in a rowsource is treated as text anyway and you can coerce a
text "2" into a numeric by using val("2") when you're later using values
from the combo box.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #2
DFS
Tim Marshall wrote:
DFS wrote:
'The value you entered isn't valid for this field. For example, you
may have entered text in a numeric field...blah blah'

So then I choose one of the number options, then go back to the text
option and voila! it's fine.


I would say it has to do with how the combo box row source is
specified, if not blank, on opening the form and/or with how you
construct the SQL for the row source after your radio button option
group is updated. I've run into this sort of thing in the past and I
had to be consistent in how I defined data types for the SQL
statement. Remember that everything in a rowsource is treated as
text anyway and you can coerce a text "2" into a numeric by using
val("2") when you're later using values from the combo box.


I'm not sure what you mean by 'everything in a rowsource is treated as
text'. When I pass a number or text field from a combobox (or listbox)
rowsource into a query or VBA code or function it's treated as a number or
text - depending on the underlying datatype.

I hate having to work around Access oddities like I describe. The worst
part is, it worked fine for a year and a half, but I've been doing
development on it and now it sometimes throws that error.

Thanks
Nov 13 '05 #3
DFS wrote:
I swear that sometimes things behave differently from one day to the next.
Access 2003.

Example: I have 4 radio buttons that set the rowsource of a combobox
depending on which option you choose. One of the 4 options has a text field
as the first column in the rowsource, and the other 3 are numbers. The
combobox has no formatting set.

Using the text option sometimes returns:

'The value you entered isn't valid for this field. For example, you may
have entered text in a numeric field...blah blah'

So then I choose one of the number options, then go back to the text option
and voila! it's fine.

If you know the error number you might also want to check out what the
rowsource is...
If err.Number = xxxx then
msgbox me.combo.rowsou rce
endif
and view the SQL for the rowsource. Maybe something is not quite right
Nov 13 '05 #4
DFS
Salad wrote:
DFS wrote:
I swear that sometimes things behave differently from one day to the
next. Access 2003.

Example: I have 4 radio buttons that set the rowsource of a combobox
depending on which option you choose. One of the 4 options has a
text field as the first column in the rowsource, and the other 3 are
numbers. The combobox has no formatting set.

Using the text option sometimes returns:

'The value you entered isn't valid for this field. For example, you
may have entered text in a numeric field...blah blah'

So then I choose one of the number options, then go back to the text
option and voila! it's fine.

If you know the error number you might also want to check out what the
rowsource is...
If err.Number = xxxx then
msgbox me.combo.rowsou rce
endif
and view the SQL for the rowsource. Maybe something is not quite
right


It's one of those errors without a system number. It appears like a
validation rule error.

The funny thing is it's basically random. When I open the form, the
combobox is populated with a rowsource where the first column is text.
Trying to choose from that list right after opening the form sometimes
throws the error. So I choose another option that populates the rowsource
so the first column is a Long, then go back to the Text, and it works.

It's frustrating, 'cause the system is going out to 100+ users eventually,
and I can't find the pattern, or the fix, so far.
Nov 13 '05 #5
DFS wrote:
Salad wrote:
DFS wrote:
I swear that sometimes things behave differently from one day to the
next. Access 2003.

Example: I have 4 radio buttons that set the rowsource of a combobox
depending on which option you choose. One of the 4 options has a
text field as the first column in the rowsource, and the other 3 are
numbers. The combobox has no formatting set.

Using the text option sometimes returns:

'The value you entered isn't valid for this field. For example, you
may have entered text in a numeric field...blah blah'

So then I choose one of the number options, then go back to the text
option and voila! it's fine.


If you know the error number you might also want to check out what the
rowsource is...
If err.Number = xxxx then
msgbox me.combo.rowsou rce
endif
and view the SQL for the rowsource. Maybe something is not quite
right

It's one of those errors without a system number. It appears like a
validation rule error.

The funny thing is it's basically random. When I open the form, the
combobox is populated with a rowsource where the first column is text.
Trying to choose from that list right after opening the form sometimes
throws the error. So I choose another option that populates the rowsource
so the first column is a Long, then go back to the Text, and it works.

It's frustrating, 'cause the system is going out to 100+ users eventually,
and I can't find the pattern, or the fix, so far.


If it isn't a "trappable" error use the forms OnError event and see what
DataErr is equal to.

I don't know if the combo is bound. If you start switching columns
around, maybe you aren't setting the real "key" in the list correctly.
IOW, if column 5 is the key, but you maybe moved it so the bound column
is now 4 then I'd expect you to get an error. Check those settings if
it's a bound column.

I think you'll find it if you do a
If DataErr = dataerrnumberyo udetermined then
debug.print Me.combobox.row source
msgbox "Check the debug window"
response = acdataerrcontin ue
endif
you'll find one part of the problem. And DO check the bound column and
the ControlSource.

Nov 13 '05 #6
DFS wrote:
I swear that sometimes things behave differently from one day to the next.
Access 2003.

Example: I have 4 radio buttons that set the rowsource of a combobox
depending on which option you choose. One of the 4 options has a text field
as the first column in the rowsource, and the other 3 are numbers. The
combobox has no formatting set.

Using the text option sometimes returns:

'The value you entered isn't valid for this field. For example, you may
have entered text in a numeric field...blah blah'

So then I choose one of the number options, then go back to the text option
and voila! it's fine.


Here's another shot in the dark. Try putting CStr(Nz(FieldNa me,"")) AS
ComboFieldName around first column numeric fields in the SQL for the
rowsource. The type conversion functions often allow Access to
determine the query field's type. The further coercion of everything
to text may prevent the mismatch. You can also try using the
PARAMETERS declaration in SQL to bounce back and forth between text and
numeric types after setting the combobox value to Null to avoid an
error when the type changes.

I hope this helps,
James A. Fortune

Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
5386
by: sedefo | last post by:
I ran into this Microsoft Patterns & Practices Enterprise Library while i was researching how i can write a database independent data access layer. In my company we already use Data Access Application Block (DAAB) in our .Net projects. We use SqlHelper in SQL based projects, and OracleHelper in Oracle based ones. OracleHelper was not published officially by Microsoft as part of the DAAB but it was given as a helper code in a sample .Net...
13
4122
by: Peter James | last post by:
Access 97 If I select New on the Query tab of the db window, and go staight to sql view and type in the following for example: INSERT INTO tblMyTable ( dtDate, txtAny) VALUES (#2003-09-03#, 'blah'); and then save the query, close it, and then reopen by clicking the design button so it opens in sql view. The sql has changed to:
8
1968
by: Will Chamberlain | last post by:
I came across a rather interesting article this morning and thought I'd share. We all know that Visual Studio is a great IDE, but I think we can all agree that it is adds a dramatic change to how we write code. I'm not posting to talk trash or start a flamewar, just wanting feedback in regards to the following article. I happen to use Visual Studio on a daily basis and am not a John Rivers alter-ego. ...
20
2103
by: Deano | last post by:
Just looking at C Sharp to see if it might be worth my while learning something new. Has anyone here tried a .NET language and tried to replicate a existing Access app? I would be interested to hear how any stories about this and in particular how one deals with not having subforms - can you get a third-party control to fill that gap?
17
4402
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 there, but is there a way they can find out if that application was put there from a CD or email or created at work? Hint: It's not on a client/server database, just native jet database mdb created on Access 2003 (default 2000)...
27
45532
by: Wayne | last post by:
I've been clicking around Access 2007 Beta 2 and can't see the custom menu bar designer. Is it in the beta? Maybe I'm blind. The question that comes to mind is: Will custom menu bars be the same height as they were in previous versions or will they be the "ribbon" style that takes up a huge portion of the screen? Also when I use Access 2007 to open an Access 2003 database that has custom menu bars they display as they did in Access...
16
6508
by: JoeW | last post by:
I'm utilizing a database that I created within MS Access within a program I've created in VB.NET. I am using the VB front end to navigate the information, but want to be able to print a report, that I've also created within MS Access. I've attempted using the Access.Application instance, but I get errors when it tries to load the database. Just wondering if anyone has any experience with this, and what I should do. Thanks for any...
7
1325
by: Damien | last post by:
Hi Guys, <Posted yesterday to microsoft.public.dotnet.framework.aspnet.security, but no responses garnered. For mpsc readers, this is a fairly common error encountered when connecting from ASP.Net 1.1, but I've followed all the help I can find online and it hasn't fixed my problem yet. So any ideas for troubleshooting would be welcomed> Yet another person suffering from the infamous "SQL Server does not exist or access is denied...
13
3539
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains some javascript code that calls window.open. I pass the resource url of page B to Page A's window.open call. Page B is then loaded and executed but none of the server-side code is rendered. If I view the source of the page, the code (and page...
162
10207
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you prefix them with 2 underscores, but I hate prefixing my vars, I'd rather add a keyword before it. Python advertises himself as a full OOP language, but why does it miss one of the basic principles of OOP? Will it ever be added to python?
0
8139
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8555
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8232
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7024
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5524
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4032
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4098
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1686
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.