Can a SQL query be written so that when the user runs the query, a prompt asks the user to enter the field they wish to see?
i.e. a query is written to return certain predefined fields, plus a field that is not defined. When the query runs an error comes up to enter the field it should search for.
It would be handy for the start of each month, when a new field (month's data) is required. It will avoid updating the query each month.
I have two tables. The first contains details of a budget holders money allocation for a given period, and the other tracks their spend on products over that period. How can I generate a query to calculate the total running spend for each user from the "budget spend table" that will be written into the users record in the "budget allocation table".
My aim is to show details of budget allocation, total spend to date and remaining budget for each user in an Order form / report.
Can anyone please advise me on how to do this or suggest another way of doing it. Any help would be greatly appreciated.
I am trying to build a query that would be pulled by indaviduals name entered by the user of the DB. I can't remember the santax to use in the critera field.
I am trying to edit the following code to be able to require the user to enter a Loan number and keep prompting the user to enter a value as long as the field is blank. Once the field is filled in, then the code should go on to check if the sql condition is met and make the necessary change if met, then finally, I have a save command code that will require the user to save the record. Right now I am getting errors when I added the code to require the user to enter a field. I am new to loop and if statements in vba so I am not exactly sure how to structure it.
Code: Private Sub Save_Record_Click() Dim SQL As String Do If IsNull(Me![Loan Number]) Then MsgBox "Please Enter Loan Number. This is a required field."
I would like my user to be able to enter dates on a report.
I have entered unbound fields on the report; but it doesn't keep any of the information (dates) for printing or otherwise. (I don't need to save these dates since they change monthly.)
i have a form with various tabs and a number of fields. If I could I would just select all fields to "required=Yes" in the table design mode. But some fields should only have data entered if another field has a certain value. So, I think I just want all visible fields for this data requirement (I set some fields to visible=false if I don't want them to have a value).
So far I tried to do this on click of the Submit Record button which I created using the "docmd.gotorecord, , acnewrec" statement, but I can't seem to make it work when combining it with if then msgbox statements. Plus I typed an if then statement for every required field.
Here's my code below:
Private Sub AddNewRecord_Click() On Error GoTo Err1 DoCmd.GoToRecord , , acNewRec Me.Label216.Visible = False Me.CM_2A.Visible = False
I have given an example in the attached excel spread sheet with a few comments at the head of each column.
1. I want to confirm that my best modelling approach for this kind of information is a series of 1 to many relationships linking the attributes in columns A->D?
2. In the example given an environmental rating is given to each make/model of car based on each combination of attributes A-->D. How would this work in terms of user form design to enter the necessary information? in order to assign an environmental rating?
In MS Access form, how can I create my own message if the user enter a value that not match with the data type of a field in underlying table? Thanks a lot!
I am trying to create a query where a user will enter information in boxes (any combination) on a form and a query will bring up the joined information from 4 different tables but I do not know where to start with the relationships on the query let alone the best method to search.
To start it off I have attached a db with the tables and the form I want the user to enter the search criteria into as well as my attempt at a query.
I am trying to clear a textbox after the user enters an invalid date and I do not know why the following code is not working:
Private Sub txtStart_AfterUpdate() If Not IsNull(Me.txtStart) Then If Not IsDate(Me.txtStart) Then MsgBox "You have not entered a valid date" Me.txtStart = Null Me.txtStart.SetFocus End If End If End Sub
I have a form that a user fill out to populate fields in my database...how can I make it so that user MUST fill in certain fields before they are allowed to save data?
I need to stop users from taking shortcuts when entering data, and skipping a lot of fields. So i would like to be able to specify the minimum fields, and an error message must show when they try save incorrectly to alert them to this.
I use filter Combo boxes in a lot of places so that users can filter records easily. (Not combo boxes for input).I have them labeled as filters but nonetheless users keep trying to input into them for some reason.How would I add a message box to it so that it states that 'this box is not for data entry etc'.
I need to be able to restrict users enter a value in the text box (on Form B) called "FTE Assigned" if Dsum of a field called "FTE Allocated" in another form A is less than what is going to be sum of FTE Assigned after the value is entered.
Both these forms are used by users to enter data in the 2 separate tables which are linked together through a join.
Master table - having FTE Allocated values and secondary table having FTE Assigned values.
Basically a message box would do if Dsum (of FTE used) is coming out higher than FTE allocated.
i want to get a msgbox to let the user enter the data in specific text boxes so they can't let it empty if not empty then do..this is my code
If Me.Client_Name.Value = "" Then MSG = MsgBox("You Should Enter The Client Name") ElseIf Me.Username.Value = "" Then MSG = MsgBox("You Should Enter The UserName") ElseIf Me.Address.Value = "" Then MSG = MsgBox("You Should Enter The Address")
[code]....
the msgboxes that tell the user this textbox is empty is not appearing what's wrong with my code
I have a form in which I collect approvals from two different departments. To approve an item the user selects their name from a combobox, and then tick an option box to indicate approval. The combobox is from table 'Users' and has a query as a source with the following fields, 'UserNum, First, Last, Password'. The 'approval' fields are on table 'Approvals' and are yes/no fields.
What I'd like to have happen is that the user chooses their name from the combobox and then ticks the option box for approval; when ticked I would like a messagebox to appear asking for the users password based on the name chosen in the combobox.
How can I make certain my user enters records on a subform before attempting to save the main form? Right now they can completely ignore the subform before saving the record.The Main form has business address, etc. on it. the subform is bound to a join table that lists the multiple categories, subcategories and sector the business is listed in for a directory.
I already have my fields set to required at the table level in the join table, and have some existing VBA in both my subform (to update edited date) and my form (to validate empty records where a certain condition is met) but that's not the issue...
How do I focus the user to enter a record on the subform to the point where they are forced to enter something and complete the subform before the record is updated.
I have a relationship from one table to another. If one item is entered into one field, I would like it to auto-populate it into another field. But there are several more fields I would like to be autopopulated.
EX Table_1
item no, hull no, description
Table_2 item no, hull no, description..
I want to enter data into table 1 and have it auto populate into table 2. How is this to be done
Hello, I want to add a checkbox in my form which will update or enter a value to a field. To explain more better the form is access of application so the question will be does the user have Network Account. if the check box is checked then it should add a value to its own field or another field in the same table Network Account. If its not checked then the field should be blank. The way i am doing is i created a check box field and then there is seperate field hiden or in front of checkbox. The control source i put is iif([checkbox1]=-1,"Network",ISnull) this way i get the value in form field but its not linked anyway to table field.
Is there any easy way to populate a field i will be having couple of checkbox like this.
Hi all, firstly please forgive me if i'm a little slow, i haven't done any access work for a year or so and i'm a bit rusty :o
Basically i have a customer database which holds customer details and orders. It's been created and working fine for a couple of years, but i recently found something that i'm having trouble with. tblCustomers holds most of the data and links to other tables such as tblCustomerPostCode/tblCustomerEmail with the primay key CustomerNumber. I put certain data such as these in other tables because i was taught to not include fields with lots of blanks and these wouldn't necessarily always have data. The relationships table is attached - relationships.jpg
I also have a main table for customer orders - tblCustomerPurchases which holds data such as date of purchase and purchase cost. This has a primary key field called PurchaseNumber, and links to tblCustomers with a CustomerNumber field. This meant i could have many purchases for one customer, etc.
Everything has worked great as i said and i have many forms, reports etc with no problems, and the problem i have hasn't shown itself until now.
If i have a query with tblCustomers and all the relevant other tables linked to it, all fields work perfectly and i can add, edit etc whatever data i need to. See qselcustdetails.jpg attached.
The moment i add the tblCustomerPurchases or anything that uses it to the query however, i can no longer add data to some of the fields such as tblCustomerPostcode, tblCustomerArea, tblCustomerEmail etc. If there is data in the field already then i can change it, but not add new data. See qselcustdet&purchase.jpg attached.
I believe it must be to do with the fact that tblCustomerPurchases uses the CustomerNumber field as well? And it then doesn't allow tables such as tblCustomerPostcode to create new data? But i can't understand why. Like i said i'm a little rusty and i can't figure it out at the mo :confused::rolleyes:
Also, can anyone tell me any suggestions for the easiest way of fixing it? The database already has 5000 customers and plenty of forms, reports etc.
I have a database with two memo fields. Both have exactly the same properties in table design view.
One field is called 'notes' and when I want a new line I just have to hit ENTER. Result is as wanted.
The other field is called 'responses' and when I hit ENTER, the cursor jumps to the next field (as if these were a text rather than a memo field). it does not start a fresh line. However, this field has not length restriction; I can copy and paste any number of lines into it. But I must not hit ENTER, and I cannot produce a line break.
As I said above, both fields appear to have exactly the same properties in Design View. Why then do they behave differently?
I have a date/time field on a form. I have a calculation that adds number of days to Date() and enters the answer in the field. Example:Date()+30. If the answer comes on a week end, can I get the date entered to be the next occuring week day? Thanks
At work I can enter +15 in a date field and it automatically sets the date 15 days after todays date. Our companies computer is operating on a ERP system. I would like to do that in an Access database I'm designing for a friend. Any hints.