Hi there, please excuse my poor access skills, I've searched the forums but can't really find what I'm looking for......I have two basic tables in my db, one is an inventory listing all the stock in the company, and this is linked to a tracking table, which contains all the different movements for this stock item......this is a simple one to many relationship, what I want to do is lookup the value of the 'In/Out' field in the last tracking record for every item, and set the quantity of that item in the inventory table to 0 or 1 depending on the value......how would i best go about this and where should i put the code.....? Any help is much appreciated.
I have a table with the following 4 fields (these are the ones i'm having the issue with but there are others).
ID, Country, City, Date
I enter data into this table via a form
The ID is an auto number. The date is simply enetered.
The Country Field is a lookup (in the table itself) with the following lookup properties
Display Control: Combo Box
Row Source Type: Value List
Row Source: "England";"Spain";"France" etc
Now the problem...
I also want a lookup in the City combobox (on the form) which changes to reflect what was selected in the Country field.
E.G
If in the Country Field Spain is selected then in the City Field I should have the option of selecting Barcelona, Madrid, Valencia etc.
I was told to use the following code in the afterupadate of "parent combobox":
Private Sub ComboCountry_AfterUpdate() Select Case Me.ComboCity Case "Test" Me.ComboCity.RowSource = "A;B;C" End Select End Sub
Ive tried it but as always i get an error when i use the country drop down...
A pop up box with:
Compile error: Method or data member not found
and visual basic opens with the top line of the code "Private Sub Country_AfterUpdate()" highlighted in yellow, and the ".RowSource =" is highlighted in blue.
These are the properties of my form
My Country Combobox is called - "Country" My City Combobox is called - "City"
I have put the above code in the after update of the "Country" combobox as below:
Private Sub Country_AfterUpdate() Select Case Me.City Case "England" Me.City.RowSource = "London;Manchester;Leeds" End Select End Sub
Anyone know where the error in the code is? Obviously i have reduced the code to include only one case.
I have created a simple query to subtract field B from field A and store this value in field C, however now I need the query to lookup the value from field C in the previous record and store it in field D in the current record. I'd appreciate your HELP
I have a database with various tables containing information about students, timetabling, assignment submission dates and multiple tables with grades for various assessments. All grades are held as percentages.
In a large number of different queries / reports I want to output the grade as an item from verbose scale with 17 points (excellent first, high first etc.). I've set up a table called 17pointscale which contains fields called 17pointscale (with the verbose names), lowerlimit (number) and upperlimit (number).
I have a query in SQL (which works) to take the percentage grade from one of my grade tables AssessedWorkGrades.Grade and return the text on the 17 point scale.
SELECT AssessedWorkGrades.Grade, [17PointScale].[17PointScale] FROM AssessedWorkGrades LEFT JOIN 17PointScale ON ([AssessedWorkGrades].[Grade] >= [17PointScale].[LowerLimit]) AND ([AssessedWorkGrades].[Grade] <= [17PointScale].[UpperLimit]);
Is there any way of converting the SQL to a custom vba function which would enable me to use this as a lookup in a large number of queries.
I think that it should be possible to set up a function called ScaleGrade and in any query Expression: ScaleGrade(XXX) will take XXX and return the 17 point scale.
I think that AssessedWorkGrades.Grade needs to be replaced by a variable that is inputted on use of the function but am not sure how to accomplish this.
I'm wrestling with the issues; in other threads, it became apparent that because I could not know ahead of time what I will need to know about a given entity, I will use a table to enumerate attributes that is applicable for a given entity.
However, the stumper is that what if an attribute should conform to a set list of values? Since they are dynamic, I would have problem predicting what I will need to be able to lookup, and am even don't know whether I will need a one-many lookup or many-many lookup.
I thought that generic lookup table with a table listing "classes" of lookup would allow me to have one big generic lookup table while using "classes" to act like virtual tables so I can then set the query to appropriate "class" to return just right set of values.
But as I thought about it, I ran into some issues which is pulling me toward the crazy idea that I should have freestanding tables, and use a field in tblAttribute to give me the table's name so I'd know which free-standing table it points to, and have the necessary key to lookup the values within that table.
Even though my gut instincts tell me that I shouldn't be going against the conventions of database design (who the frick goes around creating free-standing lookups?!?), I'm simply not sure how I can use a generic lookup table to hold all information.
For example, suppose I was given a list of values that has its own categories. Since the former design allows only for two level (lookup and lookupclass), where am I to insert that extra level?
Furthermore, I found myself needing a set of virtual keys to reference a certain "class" of lookups for report purposes. That means I need an extra field in my lookup table than I originally anticipates. What if I find myself needing one more field that just won't fit the generic lookup table?
So does anyone have suggestions on how we would create a placeholder for a lookup table that will be made just in time?
I am creating a customer database for an independent insurance agency. Within that customer database, we have a lookup field that references another table "Carriers". This is where we select the insurance carrier we have placed the clients insurance with (ex. Geico, progressive, etc). This field allows multiple entries since clients can have policies with different companies.
We also have contact detail forms for each of our insurance carriers where we store information like web logins, contact phone numbers, and other notes. These forms are based on the same table as the lookup field.
I would like to create a hyperlink so, if we are looking at a clients form with all of their contact info we can click the insurance company in the carrier field and it will bring us to the contact details form of that carrier.
I have three large source tables imported into my database. I have created queries to retrieve relevant values from fields in each source table which feeds into my form. Each field on my form that is connected to the relevant query is a lookup field. For example, one field called "Supplier_Name" another called "Supplier_Code" and a third called "Route_Number".
Needless to say each of my lookup fields are very long. I am trying to filter my search based upon the selection from the previous Lookup field. How I can filter a lookup field's value based upon the previous lookup field selection? Each Supplier has a code and assign route(s) and I have already established these relationships.
I need to create a form to allow the user to look up patient information by entering the patient's social security number (SSN). The form would have a blank box asking the user to "ENTER THE SSN." When the user enters the SSN, it would show the other info from the table (e.g., name, psychologist, psychiatrist, etc). Unfortunately, I can't use a list box for confidentiality reasons. Is this something I can do with Access or do I ned VB? Any advice would be helpful. Thanks much!
I want to be able to choose a record from the combo box and then the rest of the fields fill in themselves... Also some of the fields are in a subform but are all linked to the entry in the combo box... can someone help me ? :confused:
I have a contact dB with 2 contacts (main & alternate). I would like to be able to pull any record containing either the main or alt last name up. Right now the unbound combo box works fine pulling up the first contact name but I need to be able to pull up a record if the second contact name matches as well. I am trying to use 1 unbound combo box to look at both fields (LastName1 & LastName2). Is it possible and how should I set it up?
Hi, I'll give you a little background info before I ask my question:
I have a table called "Company" with the following feilds: Company_ID (PK), Ticker (Indexed, Unique), Company Name
I have (or at least want) a single record access form, and now for the problem:
I would like someone to be able to type a ticker into the ticker feild, and have it search for an existing feild with that ticker (it would automatically populate company name with the correct value). Now, if the ticker doesn't exist, I would like it to bring up a new record form so the user can type in that information. I know I've seen something like this before, but its been a while since I've used access, so I'm still kinda brushing up on this stuff. Can anyone help me out here? Thanks!
I have a form with a combobox based on a query of a lookup table. If the name entered is not found in the combobox, I want a popup form to open allowing the user to enter a record for this new name in the lookup table, then close. What is the best way to this? A command button? The Not in List Event? A msgbox? I'm not sure.
Now I have a standard order entry form which works fine, my problem is with the subform: frmPurchaseOrderDetail ProductID Description Qty Nett
On my form Description and Nett are auto populated referencing ProductID but this information does not transfer to the table tblPurchaseOrderDetail. The main problem is that a nett price can occasionally chanege (inflation) but I need to be able to look back to a particular order for audit purposes and be able to see what I paid.
I'm sure there is w way round this, but I've been unable to figure it out. I've gone through loads of different threads on the forum and as a result am sure it can be done, I've also looked at the examples posted by several users, but none seem to approach the lookup quite from this angle, does any one have any idea...sorry for the long post, thanks.
This is going to sound really stupid but I urgently need to have one form, where people can enter a product code and the description automatically shows in another field.
I have two tables, one for the form and another with all product codes and descriptions.
Presumaby I would need to make a query, which i've tried and failed miserably.
it seems so simple when you read the access help but i've missed something fundamental.
HELP!
Thank you.
PS I should have said my boss expects to enter data in one field - the product code - and the description automatically and instantly pops up in another field on the same form before leaving that particular record.
I am wandering if anyone can help me here. I have a form which is linked to a table called tbl_File. Within in this form & tbl_File there is a field called Country_Code. In the Country_Code field the user places a number that corresponds to their country they want.
Now Country_Code & the corresponding country is defined in a seperate table called tbl_CountryCodes.
What I would like to do is in my form once the user has inputed a number in the Country_Code field (it will be a combo box), a label or textbox in the SAME form will then do a search of the corresponding Country name in tbl_CountryCodes and then display it to the user.
I'm having a few issues with creating a Lookup on an Access form. I'll recreate the scenario below as best i can to help with my explanation.
I have 2 data entries. The first is a Post Code (Zip code), and the second is an Area Rating that applies to the Post code. For example:
Post code AB1 8 is awarded a rating of A Post code SO1 3 is awarded a rating of F
I have already created a table in Excel with all 2,922 Post Codes (AB1 1 to ZE3 9) and the corresponding Area Rates (A to F)
What i'm making is a form that holds customer details. I'd like a combo box or text box that when you type in the Post Code, another text box automatically displays it's corresponding Area Rating.
Code:Post Code: Area Rating:------------- --------------| CM2 7 | | A |------------- --------------
I apologise for my really very poor diagram :P
So the Post Code box is either typed into or a combo box with the list of Post Codes, and the Area Rate box cannot be typed in to, but it automatically displays the record dependant on what is in the Post Code box.
Ideally, these will also be recorded onto the main table (IE not the table with the list of post codes or area ratings, but a 3rd table holding the rest of the details that will be used to create statistics and graphs)
Can anyone help me with how to do this? I've been trying to work it out all afternoon!
I have a form with a combo box that contains a list of Employee Names which are contained in an Employee table (column 1).Just below it I have a textbox titled Employee Number. This field should remain blank until an Employee name is chosen from the combo box at which time it should populate with the corresponding Employee number which is column 2 of the Employee table.
I have my main form which is connected to my main table - Query 1
I have a lookup table (actually a view from SQL Server) which holds my user name - the username used to login to the database- just one value.
In my main form I have a 'Logged By' field. I want this field to default to my login name when I process a record.
I thought it would be as easy as connecting the lookup table to my main form and then in default value typing My_login.user_name.
Apparently not. It just has the #Name? in there.
Anyone have an opinion on this ?
I can use the =environ("username") in the default value which works to good effect but different users use each others PC and I would like the field to be defaulted to thier database login and not thier windows on.
Please help ! It seems so small and its driving me ceeerazy !
Okay, for simplicity's sake, I have a data entry form.
It is bound to tableData.
Inputs are:
ProductID Customer Name
ProductID is a combo box.
There is another table called tableProduct. In this table, is ProductID and ProductName.
For convenience sake, when a user chooses a ProductID from the combo box, I want it to lookup that ID from tableProduct. However, how can I do this when everything is already bound to tableData?
Okay, for simplicity's sake, I have a data entry form.
It is bound to tableData.
Inputs are:
ProductID Customer Name
ProductID is a combo box on the form.
There is another table called tableProduct. In this table, is ProductID and ProductName.
For convenience sake, when a user chooses a ProductID from the combo box, I want a separate textbox to lookup that ID from tableProduct and display the ProductName.
I have been editing the service call management database that comes with office XP.
I have a table called "Workorders" with fields: WorkorderID (primary key) CustomerID
And another table called "Workorders by Customer" with fields CustomerID (primary key)
I want to be able to have an input form where I input a workorderID which then opens the "Workorders by customer form" by customerID which relates to the WorkorderID in "Workorders" which is typed in the input box.
Im only a novice and its the code part that im struggling with.
I wanted to create a field lookup with values that I specify, not on the table sheet, but on the form. User can click on a text box or combo box and can select a list of value that I specify, not values that are listed on a table but ones that I type in, in the form.
i am working on a school database, in data base i have create two tables tblAccounts and tblTransaction and a form frmTransaction .
tblAccounts contain two fields GLcodes Description and frmTransaction contain Glcode transaction type debit credit date narratives
in form when i enter a glcode, lookup field match the code from tblaccounts and shows the description in form against gl code.But i am facing a problem when i enter a wrong gl code my form accept it and move to the next field and when i leave blank field of glcode same problem that i am facing, i want that , when i enter a wrong glcode in a form amsgbox will apear that asking for correct glcode.