Generating A Numbering System Dependant On Other Feilds
Apr 20, 2007
I have used and maintained Access databases in the past but this is my first experience with building a new database. I started by borrowing every Access book my Tech department has on hand and going through them. I have gotten to the point where my tech department can not help me because my question is beyond their own knowledge. I have searched through many different website’s forums and have failed to find what I am looking for. It very well may be out there and I am using the wrong terminology in my searches. The most important piece of information to be stored in my entire database is of course the one that I am having the hardest time figuring out how to set up.
I have a table called “Document Index” which will be a master log of every document that passes through my department. This table has the three fields which are important to my problem/question.
1. The “LOC” field represents the location at which the document was logged. The “LOC” field has a working validation rule that only allows a “D” or “S”, representing the department head’s office or the site office.
2. The “DUO” field value represents the three digit unique number assigned to a project by another department (accounting)
3. The “ID Number” field is a unique number we will assign to each document that is this table’s primary key. It is also where my problem sits. The “ID Number” format has been decided upon by my boss and the rest of the office has already begun stamping these ID Numbers onto every document (which I will have to go through and enter once the database is complete). I am stuck with the format as it is shown in the example below.
“ID Number” format is: value of “LOC”- value of “DUO”-number
I know what I want the field to do but I have no idea how to turn my ideas into the proper code to see if it works. So here is my idea of a solution with example values entered.
A.Fill in form for “LOC” and “DUO”
B.At this point Access would run a behind the scenes search and return all ID #’s that had a that “LOC and “DUO”
C.At this point Access would run a behind the scenes search through only those records found in step B to find the highest “ID Number” previously assigned
D.At this point Access would make a calculation: adding one (+1) to the “ID Number” found in step C
E.At this point Access would insert the result found in step D into the “ID Number” field of my current entry (which until this step the record only contained the “LOC” and “DUO”)
For example: if my first 4 entries had this info:
LOCDUOID NumberDocument Description
D410D-410-1 Wendy’s Ransom Note
S410S-410-1 Priate's Demands
D415D-415-1 Cinderella’s Birthday Invitation
D410D-410-2 Peter Pan’s Response to Ransom Note
Then I complete step A by typing into the form:
LOCDUOID NumberDocument Description
D410D-410-1 Wendy’s Ransom Note
S410S-410-1 Priate's Demands
D415D-415-1 Cinderella’s Birthday Invitation
D410D-410-2 Peter's Response to Ransom Note
D410
Access would execute step B finding:
LOCDUOID NumberDocument Description
D410D-410-1 Wendy’s Ransom Note
D410D-410-2 Peter's Response to Ransom Note
Access would execute step C finding:
LOCDUOID NumberDocument Description
D410D-410-2 Peter's Response to Ransom Note
Access would execute step D finding:
D-410-2 + 1 = D-410-3
Access would execute step E:
LOCDUOID NumberDocument Description
D410D-410-1 Wendy’s Ransom Note
S410S-410-1 Priate's Demands
D415D-415-1 Cinderella’s Birthday Invitation
D410D-410-2 Peter's Response to Ransom Note
D410D-410-3
Then I would finish entering the information for that record.
I would appreciate any help you can offer, even if just pointing me in the right direction or correct terminology for my searches.
I have the following code for the text field (Before Update)
If IsNull(Me![DyNo]) Then Me![DyNo] = Format(Nz(DMax("[DyNo]", "[tblAllDet]", "[TheYear]='" & Year(Date) & "'"), 0) + 1, "00000") End If Me![DyNo] = Format([DyNo], "00000")
The code starts giving numbers from 00001, 00002, 00003 and so on. The problem was that when I have to search, I have to type the zeros before the number i.e. 00007, 00008 etc. otherwise the search form doesn’t show the relevant record. Ideally, I would like the numbering system to be 1, 2, 3, etc. (without the zeros). I tried changing the code to “0” but with the single “0”, I am unable to insert records beyond No.10. Is there a way to change this code so that I get only 1, 2, 3 etc and not with preceding zeros ? Grateful for help.
I have our primary web based inventory system that I am exporting to Excel and using this as an import to Access for the main raw data for my database. This being inventory it changes daily so I am updating this table every day. When I try to append the table it ads all the records. I am wanting an easy way to add only the new records/take out the ones that are no longer there. Basically update the table with what is currently there.The only have I have found to do this is by running non-matching queries and update queries.
right all tables are like a 2d array so does any body know how i can access a field in a row of a table ie like in most languages it goes a bit like this ArrayName(1,1) with ArrayName being the name of the table and that access the first field of the first row. im new to Vba and access 2000 but all i want to do is access the fields in a column of a sub-form displayed as a table add them all up and place the answer in a text box on the main form stick all this in a function so i can run it inside a macro
Can anyone please help or advise where I can look for help on this problem. I have a subform which shows all my outstanding orders. Below it is a calculated field which shows the total weight of all the orders. (Steel Beams) I would like to be able to highlight the weights on certain orders & show total weight for only these orders. (Similar to the way it can be done in excel) I have been trying to do it via a query with a Yes/No check box & when I check the orders required the total weight changes. But I cannot get it to work properly as this puts a Yes in the field & the record disappears. I only want it for a quick reference to save doing mental summing up so don’t want to change or add anything to a field to get answer. Can anyone give me any ideas please?
I have four feilds and im trying to subtract them in a query
This is what the SQL looks liek for two feilds. but i have 4, i was gettign and error when i added other feilds Format(Val([CFR_ALLOWED])-Val([CFR_DEDUCT]),"0000000000") AS [Form Total], im trying to subtract these feilds Here are my feilds Allowed-deduct-other-Coins-Cob
Hi every body. I have an access database that u can see the tables and their reletionship in the link i posted. I would like to web enable this db and would like to get some suggetion on what fields should i allow to be edited and what records should i put delete option for? In order to keep the refrential integerity of the acces db.i be happy to get some feed back from u guys.Thanks
I have a query with below formular which return's all records between Sunday and Saturday
Between Date()-Weekday(Date())+1 And Date()-Weekday(Date())+7
I can get this formular to work when it is looking at one date feild. (Date Received). I would also like it to look at the (date completed) feild so I get all records entered & completed in the previous week. I have tried putting same formular in the OR critiria as well but cannot get it to show all records at same time. What am I doing wrong ???
I have looked everywhere for a solution to this and found none. Its an annoying issue which I would like to get around.
Here is what happens.
I have a union query that gathers rows with different criteria together. The query works execept that the yes/no feild which is set to display as "Yes" or "No" is displayes as 0 for No and -1 for Yes.
I understand that the numeric values are the underlying values of yes/no feilds in access, however they are displayed as yes/no in all my queries and reports execept my union query.
I will include the union query here in case.
The following code is a function that I use to build the union query on the fly based on some parameters. If you are asking why I am doing it like this is becasue I need the rows that have a value for the feild schFeilds(0) to be on top of the final results followed by the rows that don't have any values for the above mentioned feild, and I want them sorted. I found this method to be the only one that gives me the result in the order I need.
I have a list of Stores of which there are 4 Formats (Super, Extra, Metro, Express). Each of these formats have their own specific grades.
What i want to do is when entering a new store via a form, In the Format box i would choose one of the formats from a combo box then when i progress to the Grade Entry, i would only want to see the Grades for that particular Store Format.
Would i need to have different lookup tables for each of the format grades & how do i achieve the above?
Ive seen this done on Airline web sites, ie select outgoing airport then the destinations change to only those that can be reached by flights from the Outgoing airport.
Quick question for you. I know how to set a required field, but how do I edit two field so that they are dependant on each other? IE. How do I set my form to make FIELD1 required ONLY if FIELD2 is empty and vice versa? Thanks very much and I hope I've explained myself correctly.
What's the correct syntax to search for in the forums, for this question.
Have a customer database, where the customers records are split across two tables. The second table holds the customers address; when this changes I need to record the date so that in the future, any invoices etc always have the correct address on them for that particular date.
I have a cross tab query which works quite happily and when you create the record it adds a date/time stamp. However what I cannot seem to figure out is how to save any ammendments to the address etc as a new record, whilst not adding a new record to the non "dative information" such as Name, DOB etc. The PK for table2 is made up of the Customer Number And Date/Time Stamp. At the moment any changes I make to the existing record in table2 simply over writes the edited fields..
Can I do this through the QBE, or does this have to done using recordsets?
I have a question about lookup fields. I have the tables below. The main table is [vid] and i reference other tables like [manufacturer], [model].. etc. to fill in [vid]. I have pull down lookups for all of [vid] but it is showing all models, makes, etc. I need helping making the lookup row dependant. For example when I am in [vid] and click on the [model] combo box for vid=1, I only want to see the models for that manufacturer(Ford), so it will only show mustang, escape, and navigator; not all of the models. For vid=2, when I click the pull down for model I only want to see Gm Models, corvette and cavalier. So this is what i mean be row dependant. Is this possible?
Thanks so much in advanced, Michael
[vid] vid,year,mft, make, model, submodel, ... 1,2005,ford,ford,Mustang,GT 2,2005,GM,Chevrolet,Cavalier, LS 3,2005,dcx,Jeep,Wrangler,base ... 30,2005,ford,Lincoln,Navigator, base
[manufacturer] mid,mftName 1,ford 2,gm 3,dcx
[Model] modelID,modelname,modelmft 1, Mustang,Ford 2, Escape, Ford 3, Corvette, GM 4, Cavalier, GM 5, Navigator, Ford 6, Wrangler, DCX
Hi, im kind of new to access and im not sure whether this is possible or not, but i have a problem which needs to be solved by 4 list boxes on the same form.
The first list box will have 4 choices in it and depending on which one is chosen the second list box will be updated. This continues on to the 4th list box, which when a choice has been made a new form will open with the relevant information from the tables.
I hope this is enough information to enable someone to aid me with my problem, thankyou very much for your time.
I would like to know how can i reference a combo box to the value of a text box on the form it is for a purchasing system.
if i select product one i only want the the order quantity for that item to show and the same with the price field as all the reorder levels and cost information is stored in a table. i have created queries only selecting the product code and reorder quantity and the product code and the cost price.
I have a control called Pnummer (its personell number).After a user enters this number i want my combobox called Kenteken (Licenseplate number) to fill with only the licence plate numbers of the employee from the table Parkeerbeheer (Parking management).Should be simple enough, its like cascading comboboxes but then with only one combobox.So i put this code in the afterupdate event of the Pnummer control :
Code: On Error Resume Next kzlKenteken.RowSource = "Select parkeerbeheer.kenteken " & _ "FROM parkeerbeheer " & _ "WHERE parkeerbeheer.pnummer = '" & fldPnummer.Value & "' " & _ "ORDER BY parkeerbeheer.kenteken;" I have left the rowsource blanc as above code handles that.
The only thing that comes to mind why it doesn't work is that the table bound to this form is NOT the source where i pull the licenceplate numbers from.
I have a list box containing various items. I would like to have another field return a numeric value depending on what is selected in the list box. For example, if Closed is selected from the list box, the other field would return a 1. How can I do this. The new field also needs to be linked to a table so the values are saved in the table. Thanks for the help.
Is it possible to hide text boxes/controls on forms dependant on the user ? I have a had a (quick) look at access security and it appears that it just enables read/write access to objects not controls on the objects.
I would like to somehow put the link to the picture in a field in a table, and then have the picture change depending on the record I am viewing (which is altered by the combo box pertaining to another field) ok thanks!
First please accept my apologies if this has been done before. In the attached database I am going to have a form which is continous what I am looking to do is change the colour of the box which is in the background to the associated colour from the quote table for example
if they choose water then it will look at the TBLQuoteType and change the box colour to the colour which has been assigned to that value.
Hope this explains it ok I will continue to try and figure it out but I thought I could also use your expert knowledge.
I am sorry to have to ask. I have been researching for the last two weeks and still can't find the solution.
Could you help me. I have a web page in asp, which has a "submit" button. When this is pressed I want to access a MS Access database called "Passliabcapture" within this single database - I want to examine each record in one table (results), and then dependant on the results of the examination (ie if the value of a status field - "D"), add a new record to a second table (transaction file), and then continue looping through this function until the end of the first table.
Sorry if it seems simple - but I think I am - simple that is...
The code I have tried is as follows. All I get is an error saying
I am very new to Access and all that it entails but I have really learned a lot viewing everyones posts. I cannot seem to get my current problem solved. I am trying to have a combo box appear depending on a preivous combo box selection.
1st combo box is "ApplianceCombo" 2nd combo box is "SpeedCombo" Set to Visible = No
1st Combo Box has Dishwasher Vacuum Washing Machine etc
If they choose Washing Machine I would like my 2nd combo box to appear which they can then choose 1000 1100 1200 1300
Hope I have explained this well enough. Thank you in advance for any help Kim