473,396 Members | 2,098 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,396 software developers and data experts.

Access Autonumber problem

Hello

I am trying to use autonumber on an invoice with the prexif "CRW", so the Invoice ID will be CRW00001, CRW00002..and so on. I have put a Format of "CRW"00000 in the table design for the field Invoice ID and the tables are succesfully creating the Invoice ID with the "CRW" prefix in an incremental Order..I have created an form and i want the user to be able to use the field Invoice ID (e.g. CRW00001) to search for records of customers etc. I have created a combo box and linked the sub forms Customer to orders.

The problem is that in the Order Form when I enter the invoice ID "CRW00001" in the combobox I get a type mismatch error.

Please help!
Jan 5 '10 #1
7 2897
NeoPa
32,556 Expert Mod 16PB
You tell us little about the form, but I suspect you are trying to enter into a control bound to an AutoNumber field. This is neither possible nor sensible. To help more specifically we would need more specific information.

You could also check out Example Filtering on a Form for an explanation of how to search within forms.
Jan 5 '10 #2
Thanks Neo for replying, My combox is not control bound, It is simply a type mismatch error. Autonumer is a long integer..I have formatted this long integer in the table design to include the prefix before the autonumber.

I have created a form from the table order which has an Order ID as a unique ID, These Orders have a man-toone realtionship with customer.

I have then created another order form(order form 1) and sub-formed the order form with the customer form into a tab page arrangement. They are linked by Order ID.

In order Form 1 i have created a combobox which returns a value with matching Order ID's. However the formats that i definded in the table are not pulling through into the forms. e.g in the table an order ID would be CRW0001 but in the form the ID is 1...When i type CRW0001 into my combobox i get a type mismatch error, i.e i am not allowed to enter Text in a numeric field.

Thanks
Jan 5 '10 #3
ChipR
1,287 Expert 1GB
If you've set the Format for the field, you have only changed the display. The value saved in the field is an integer, so CRW0001 won't match it, while typing in 0001 should. I would probably just use a text field for this, and skip the Format.
Jan 5 '10 #4
NeoPa
32,556 Expert Mod 16PB
@beadman
This seems entirely contradictory. If the ComboBox (which is a control btw) is not bound, then there is no relation to the table or any of its attributes at all.
@beadman
In this case, as Chip has indicated, you are going about this entirely the wrong way, as well as expressing your problem quite wrongly. I expect this simply means that you're quite new to this, so no harm now we understand what's occurring a little better.

I'm afraid it does mean that you will need to consider going back a step or two and reconsidering how you'd like to approach this whole problem. We can probably help, but you'll need to be clearer about how you communicate the problem to us. I suspect the first step is to determine whether the ComboBox is actually bound to any field in your table.
Jan 5 '10 #5
ChipR
1,287 Expert 1GB
NeoPa, would it be correct to say that the control source of the combo box is unbound while the row source is bound to the table? Normally I would refer to this as an unbound combo box, but I realize that's not entirely accurate.
Jan 5 '10 #6
NeoPa
32,556 Expert Mod 16PB
Is that what they're describing do you think? If so that would be referred to as unbound. I have trouble seeing how the error message occurs in that scenario. It's hard to conceptualise given the current explanation. Maybe the operator is trying to select an entry by typing it in. It's such a strange approach that it's outside of my experience I'm afraid. A clearer explanation would help, but that's so often true. It's hard to expect someone relatively new to the subject to put it clearly when so many that have been at it for so much longer fair no better.

I think I would still advise the same approach. A couple of steps back to consider what would actually be the best approach. I can't think the present one is likely to yield the expected results. Of course that's so much easier to see from a more experienced perspective.
Jan 5 '10 #7
nico5038
3,080 Expert 2GB
You should use a combobox with two columns. The source should look like:
Expand|Select|Wrap|Line Numbers
  1. SELECT [id], "CRW" & format([id],"0000") FROM test;
Now keep column 1 the bound column, take care that under format the "Column count" is equal 2 and the "Column width" equals "0" (suppresses the bound column).

This will allow the entering of the CRW, although I wouldn't use this as it's a default and thus something I would show just on a report and as a fixed text on a form.

I did use once a "controlled" invoicenumber (see sample at http://bytes.com/attachments/attachm...insert2000.zip) where the Year is added in front of the sequence number. You could use the same functions to fill the Invoicenumber and drop the autonumber, thus making the ID a text field, that can be used "straight away".

Nic;o)
Jan 5 '10 #8

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

Similar topics

0
by: Frances | last post by:
Hi All, I'm having a problem trying to add a record to a simple Access 2000 db (db is very similar to an address book but with more info than the usual address, phone, etc.). The database is...
1
by: Smriti Dev | last post by:
Hi, I have a question regarding autonumbering . I'm using linked tables between msql and MS Access. Quite a few linked tables exist with relationships. The auto increment fields once linked...
3
by: Mike | last post by:
Using MS Access XP standard install (no Jet or MDAC updates applied yet) as front end, MySQL 4.0 as backend and MySQL ODBC connector version 3.51. When pasting multiple records into the database...
1
by: Knut B. | last post by:
I have a problem with a database of concerts, where I recently tried to change the existing database with some new rows/categories and some new names on a few of the existing ones. I have an id...
6
by: HS1 | last post by:
Hello I have a table in Access Database. This table has a AutoNumber field. I use a DataGrid to show that table When I insert a new record in for this table using a DataGrid, there is a...
11
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any...
2
by: Hiyella2 | last post by:
Hello, I have a problem with a table in my MS Access 2003 table. The primary key of this table is an autonumber field set to a Long Integer, Yes - no duplicates. The autonumber made it to 10252....
4
by: keri | last post by:
Hello again, While I try and solve the calender issue I also have another problem. I have a form & table (appointments) where the user records appointments in the future. The fields include...
6
by: ashes | last post by:
Hi, I am creating an ecommerce website using Microsoft Visual Studio, VB.Net and MS Access 2003. I am new to VB.Net When someone wants to register on the website, they fill out a form and the...
3
by: limperger | last post by:
Hello! This is quite important. We have an Access file shared in a network. Every user has its front-end copy that is linked to a back-end copy. This database has an autonumber field to count...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.