Make User Select From A Drop Down List If A Number In Another Field Is Entered?
Feb 13, 2006
Hi all, i have a 2 fields in a subform named "HRS_ABSENT" & "ABSENCE_REASON" i'm trying to create some code that will display a message if the user inputs any number into the "HRS_ABSENT" field & leaves the "ABSENCE_REASON" field empty. I want to force the user to select a ABSENCE RESON (these are 3 letter codes) from the drop down list, if they enter a number in the HRS ABSENT field. Ive tried the below code but it doesnt do anything :-(
Anybody please help me out?
-------------------------------------------------------------------------
Private Sub Form_BeforeUpdate(Cancel As Integer)
If HRS_ABSENT = >0 & ABSENCE_REASON = FALSE Then
MsgBox "Please select an Absence reason"
Cancel = True
End If
Is it possible to have the user enter the number of top records to choose in a query?
I know that you can enter a number or percentage in the Top Values property of the query but I would like the user to be able to enter this number each time they run the query since it may be different each time and not always, say, the top 10 records.
Is it possible to run a basic select query to pull records based on multiple strings entered by a user?
I have a query with field criteria - Like '*' & [Type In MMDBID:-] & '*'
This allows the user to input one MMDBID and the records are retrieved from the db.
I can also use the OR statement in the same field criteria "AB123" OR "BC123", and all records based on those values are pulled back.
But I cannot get the user to input multiple values and I tried amending the SQL string based on the OR criteria above
SQL statement (Like) is below :
SELECT tblFund.MMDBID, tblFund.[Investment Name], tblCodesLive.[IOE Code], tblCodesLive.[Uptix Code], tblFund.[Red Payment Deadline] FROM (tblFund INNER JOIN tblCodesLive ON tblFund.MMDBID = tblCodesLive.MMDBID) INNER JOIN tblContact ON (tblFund.MMDBID = tblContact.MMDBID) AND (tblCodesLive.MMDBID = tblContact.MMDBID) WHERE (((tblFund.MMDBID) Like '*' & [Type In MMDBID:-] & '*') AND ((tblFund.Editing)=False) AND ((tblFund.Closed_Fund)=False));
I'm currently working on fixing an older 97 database that I've updated to 2010. I have just populated the Drop down box with about three fields. Ideally what I want to do is after having selected the item number from the drop down box I then hit the button that creates a report with the information about that item number.
At the moment...If the box is blank it reports all the item numbers, however if i fill the box(select an item) it returns nothing i.e the report is blank.
I've looked at the query that builds the report, there are only three fields that populate the. location, part number and description. from a tbl called MainDetails
the only other thing: If([Forms]![frmReports]![FLoc] Is Null,[FUNCTIONAL LOCATION] Is Not Null,[FUNCTIONAL LOCATION] Like [Forms]![frmReports]![FLoc]) it has a criteria of <>False *FLoc is the drop down box *functional location is the location field. I believe all the above does is populate the report if Floc is empty.
What can I put to make the report generate what ever I pick in the drop down box 'FLoc' source the three fields from the 'MainDetails table'.
I think this should be simple, but my mind just isn't functioning today. I have a form that people have to enter information in every hour. It has a lot of repetitive information to be entered each time, for example, they are supposed to enter their initials or name so that we can track them down if there is an issue. Is there some way, to make that field on their entry form, equal to the previous entry? Thank you!
Hi. First of all, this is my first post, so tell me if I'm being stupid.
I have a simple form, 'BuildingID', which contains a list box and two buttons. The list box lists a field from the records in the table 'BuildingID'. The two buttons are 'Add Building' and 'Delete Building'. The 'Add Building' button works fine, but I cant figure out how to make the other one work.
I want to be able to single click one of the records in the list box, then hit the 'Delete Building' button to delete the entire record. So I'm guessing I have to somehow make the record that I click on in the list box current when I click on it, then have a standard delete record button.
Just fumbling my way around Access 2007, is the only way you can create a drop down list of number by creating a table and inserting a combo box? I am trying to create a list of hours for example:
I am currently building a stock control system in access. I have a form with which the user selects a stock item from 3 combo boxes (stock name, stock weight and stock grade). The combo box links to a table of stock items. A stock item is made up of a name, weight and grade (all separate fields in the stock items table).
I wish to setup the form so as the user selects the stock name from the first combo box. Based on the value selected by the user, the appropriate stock weight(s) assoicated with that stock name will be displayed in another combo box.
Basically, I wish to take the result from one field in a form and apply its result to a query(?) in another field so as to filter(?) my result accordingly.
My problem is the following: when I receive say 5 computers in a purchase form, I want to register the serial number of each of them in another form, bound to another table.If I receive 2 units in the purchase form, my user should only be able to input 2 records in the serial form (a continuous form), if we receive 3, then only 3 records,I cannot quite figure out how to build this second (serial number registration form), so that it refuses input after the correct number has been reached.
I have an access database where I have added a new field, but I cannot find the name of that field in the Control Source list to link it from where the data will be entered. It IS in the table, too. Why in the world is it not working.
A user enters a New Job Opening into the form for New Job Opening. Later, a user enters a New Interview in the New Interview form.... when they enter the job opening number into the job opening number field, it auto-populates the other information previously entered into the New Job Opening form into an area within the New Interview form. I have made sure the new field is in the table for the New Job Openings table.
Is there a function that will populate a field with drop down menu based on two criteria?I want the the fields with first and last name to populate with drop down lists based on the employee code I have inputted in the form and job title from a query.
Path: looks at employee code from form > looks at specific job title from query > pulls out all first names in one field and all last names in another field with the same job title in drop down list from query
Employee Code: 100
Returns all employees' first names in first field with same job title:
Prince Tina Greg
Returns all employees' last names in second field of form with same job title:
Fey William Jones
Here's what the query looks like in datasheet view:
Code: Location # First Name Last Name Job Title Employee Code 1 John Smith Technician 100 2 Jane Doe Manager 100 2 Greg Jones Engineer 100 1 Prince William Engineer 100 1 Tina Fey Engineer 100
I've been trying to get dlookup to work, but no luck. Here's one of my formula:
The first is linked to a separate table that only contains employee codes because query I am working with has duplicates due to multiple records.The second is trying to link both the table and query together to populate only first name.how to include the second criteria, job title, to refine it more.
OK - I'm a bit of a novice at access and the answer to this may be very simple but any help would be much appreciated.
I have a problem getting a Combo box field in a table to link to another table and input a relevant value in another field of the same table. Here is what I've got:
Table 1 - Client Fields - CLIENT ID, CLIENT NAME
Table 2 - Client Rates (The rates charged to the client for 3 specific items that do not change) Fields - CLIENT ID, SC, LX, SX. (These last three are the codes for the items and the values in the field are the currency values for the items as they are charged to the specific client)
Thanks Table 3 - Job Details Fields - JOB ID (Autonumber for the Job), CLIENT ID (Who the job is for), ITEM (This is a combo box that selects between the items i.e. SC, LX and SX), RATE (I want this to recognise the item chosen in the previous field and display the corresponding rate for that item and for that client - This is my problem!) :mad:
I will attach the database as I currnetly have it so that you can see what I'm talking about. As I say - any help is muchly appreciated
I have created a query with the parameter for the Domain field. however on the form the user enters this information via a drop down menu. i was just wondering could the parameter box be set to a drop down box as well to save the user entering in the full Domain field name?
I'm trying to create a combo box that takes its values from a field in a table, the thing is that this field has duplicates because:
* The table is a qualification look up table * It has 3 fields: QualificationID (autonumber), Qualification(e.g. Bachelor), Programme (e.g. Science) * E.g of duplicate values (this is not a problem as it is necessary) Bachelor of Science, Diploma of Science, Certificate of Science
What I'm trying to do is create 2 single-columned combo boxes that are a parameter for a query and it's working except the combo boxes show duplicated valuesIs there a way to get the query that is the row source for the combo box to eliminate duplicates?
I've been using a SELECT INTO statement to import data from a linked text file into a temporary table in Access. Something along the lines of :
SELECT [tblLink].[fld1] AS Field1, [tblLink].[fld2] AS Field2, [tblLink].[fld3] AS Field3 INTO [tblTemp] FROM [tblLink]
(There's an INNER JOIN in there and some Nz / CLng functions but just want to keep it simple...)
Now - I've just realised I also need to create a couple of extra 'dummy' fields in my temporary table (for later on in the show) and I need them to be Yes/No format (will set them to False at first, then run some separate queries later to update them)
I tried this :
SELECT [tblLink].[fld1] AS Field1, [tblLink].[fld2] AS Field2, [tblLink].[fld3] AS Field3, False AS Field4, False AS Field5 INTO [tblTemp] FROM [tblLink]
But this sets Field4 and Field5 as Number fields, with each record given a value of 0. What syntax is required in the SQL to make these fields Yes/No rather than Number?
In Access, when using Look Up function, Table/Query, how do I make more than 1 field from the query appear in the drop down list?I will be doing the same thing for students and some other tables. But for this example I am only wanting to show instructors first and last name and their ID number in the drop down.
I am using
Code: SELECT instructors.first, instructors.last, instructors.ID FROM instructors; in my Classes table.
What am I doing wrong?
I would like for it to show their instructor first and last name but actually put the ID in the field as I will be using that key for various relationship based functions. Show the first and last name to the person who will be using the database, but actually put the ID in the field so I can use it as a common field across other tables.
I have a KidShop table that shows the Diagnosis for the person,there are 5 diagnosis fields because one person could have up to 5 Diagnosis and each field is a lookup from the diagnosis table.in the report they show up as the ID number not and not the text.
I inserted Diagnosis from the Diagnosis Table and a window popped up asking what Diagnosis from the Diagnosis table matched in the KidShop Table and gave the selection of Diagnosis 1 or 3 or 3 or 4 or 5. I could only select one and I selected Diagnosis1 in the KidShop table and that showed Diagnosis as text for the Diagnosis1 field but the other 4 diagnosis fields still show a number. I understand what that did but it does not give me the option to match Diagnosis 2,3,4,5 to diagnosis Table. If I changed the Data source for the other 4 to Diagnosis then only Diagnosis1 shows up it the other 4 fields which makes since.
On [Form1] I have a Multi-Select Listbox[List1] which shows Job Numbers [WBS] (The job numbers displaying are a result of a separate query filtered by the Fiscal Year combobox). When I click [CMD1] I want [Query1] results to only be selected [WBS] from the form.What is the best way to code this? I'm a beginner when it comes to VBA.
Query that I have built to create a subform on one of my forms. It's my goal to make the subform easily navigable/query-able for the users, and that is where I've hit a roadblock. The subform contains a field - Balance - which I would like users to be able to search based on numeric/mathematic expressions (i.e. >0 and <40). In testing I have created a text box on the main form (BalanceCriteria), and linked it to the subform's balance field through the query in the Criteria field (forms!MainForm!BalanceCriteria).
This works fine with exact numbers - entering 19 will return client's with a balance of 19 - but returns an error - "Expression is typed incorrectly or is too complex to be evaluated" when tested with a numeric equation (>0).
I have look around in the forums, but I haven't found what I was looking for. I just maybe didn't use the correct search criteria. But anyway this is what I am looking for.
When a certain user Logon into the database. I would like the have a message sent just to that one particular user. Bottom line is. When a report is due and that user is responsible for it, I would like a notification go to that user.
I am creating a database to track a student's course load in a degree program.
When the student enteres their ID on the first form I want to retain that value so subsequent forms and views display their records, or allow new entries/updates to different tables without re-entering their ID. I'm having no luck passing the value entered into the first form's text box to other processes selected prior to closing out the database.
I have a multi slect list box (simple) and I need to find and select an item using vba - e.g., the bound column is the ID field and I need to select a specific ID (which will be different each time) as opposed to selecting the 100th record for example. How do I do this?
I want a default value to equal the first 2 characters of field [first name] and first 3 characters of field [last name] and the numeric datevalue of [DOB] 'date of birth'.
In excel its easy, C D E resultformula AndrewTester12/12/1980AnTes-29567
Formula LEFT(c9,2)&LEFT(d9,3)&"-"&e9
How do I get same result in Access?
tried
Field 'PRN', a text field set as default =""""& left([first name],2}+LEFT(Last name],3), date()&""""
Access accepted the above statement but when I input user details the default doesn't work.
I am making a simple database for the computer laboratory in school (my place of work). Actually it is a Automated Logbook System. Here's the Problem. I want to make a form that will prompt me whenever I enter the data(ID number) of the user(student) 3 times already for the current week.