I know how to make a text box entry "required" such that one cannot exit a record until a value is entered but cannot figure out how to make it required only if another field on the form has an entry. None of the form events seem to support that when focus moves to another record as far as I can tell. What I want to do is display an error message if the condition is not met on exiting a record but to also remain on (or go back to) that record so the required text box entry can then be made.
I have a form with three text boxes and i am trying to figure out how to ensure atleast one of these boxes is required and would error if none of these are completed.
I am using code like this to give warning messages and pass on focus to boxes only when things are selected.
Private Sub TextBox2_Exit(Cancel As Integer) If IsNull(Me.TextBox2) Then MsgBox "TextBox2 cannot be left blank" Cancel = True Else ComboBox1.SetFocus End If End Sub
I do this for a series of required fields in order.
However, I also want a command button that is 'Exit without Saving' that should be clickable at any time, but of course when focus is controlled in my required fields sequence, it can't be clicked. How can I separate this button?
Is there any setting that I can use that will make a form always open to a new entry?
I don't want people to be able to edit the form.
On the form I have created a New form button and a Save and clear button, but i would prefer it to be that when they open the form its always a new entry and when they hit save it just save and clears and comes back to a new entry form.
These are my buttons.
Code: Private Sub Command103_Click() DoCmd.RunCommand acCmdRecordsGoToNew End Sub
Private Sub Command90_Click() RunCommand acCmdSaveRecord Me.Requery End Sub
I have a lot of fields that I want to make required entry only if one of the check boxes I have is blank. If the check box is blank then I don't want any entries to be required.
For example, I have a form that needs to be filled out only if a machine is running, if the machine is not running then only certain fields need to be filled out and the user will select the check box labeled "Machine not running".
BTW, I'm very new to Access and have no experience with implementing code, other than with excel.
I have created a form with 3 subforms. This form is split in to 3 parts on a 3-page tab control.
I want the user to enter data in the order below. All fields are required. My problem is that Access97 wants all fields of the main form to be completed in the order set by the table. ie. before I fill in a sub form. I have tried setting the form tab order property but it is being overridden.
First page: a) Complete first 6 fields of main form b) Complete subform 1 c) Complete subform 2 Second page: d) Complete 5th field of main form e) Complete subform 3 f) Complete 6th field of main form Third page g) Complete three fields of main form
I have made a form based on related tables. it requires me to fill out every field, which I don't want. I didn't make them required. Why does it do that?
I have 2 forms, a master and a subform. In the subform form there are some required fields. In the table behind the subform I choose the property of these fields to be required. but in the master form, when I start enter the information I can go to the next record without even touching the subform.
How Can I make the subform required in the master form?
I need to make my mainform fields required before any data can be entered into subforms. Mainform and Subforms are linked with LinkMaster Child ID. This should only be applied in this form.
I'm working on a series of forms for a company that I'm currently employed at, and on one of them I've made a listbox which will display records which need action in the next 2 weeks.
That's all going fine. However, it it possible to make the items in the listbox flash red? Just so that our external worker REALLY has no excuses!
Just to clarify, I want the text identifying the records (E.g. Name, FinalDate) to flash, but not the headers for the columns in the listbox.
I have a simple data entry form with drop down facilities on 2 fields. One of these fields incorporates a drop down list from a table but there are occasions when I wish to make a free text entry for the single record, but do not wish to add it to the drop down list.
I have tried to achieve this with a Combo Box but without success, although I am sure that I have read that it is possible.
Hope all is well! I have one text box among others in a form that require the user to update data in that particular text box every week. I already put a msgbox in the Textbox_On Got Focus to remind the user to update the data. However, the user still can ignore and move on to others text box. Please advise HOW to FORCE the data to CHANGE/UPDATE something in that text box.
I am working on creating an access database for tracking physical assets linked to locations. I need to make a combo box list to show items other than the current location of the asset. Basically I need it to refer to last enery of the user and define the new possible entries. so we have a unique relationship between location and asset. The assets and location will always remain fixed and there is never going to be any addition. I am creating a web form so that it can be uploaded into sharepoint.
Is there a way to make just part of the text in a text box bold, or to use different font sizes in the same text box?
Something like this:
--------------------------------- Heading in bold: description in regular (not bold) (a smaller height line used as a line space) Another "normal" line a larger height line a normal line....all in one text box! ---------------------------------
One thing I'd like to be able to do is to specify the line height of a blank line in a text box. I'm using carriage returns created with: Chr(13) & Chr(10). I could see defining the font size of a hidden character, but I'd need to know how to assign a font size to a piece of the text in a font box.
I have a form for inputting Crisp Brands. On the form is a Txt_box for entering the crisp brand an unbound txt box for renering the text box to ensure spelling is correct and a lst_box listing all existing crisp brands in the sytem.
First question is:
1) When i open the form i only want to be able to add new entries and not be able to edit old entries. However i would like some people to have the ability to edit existing ones. Is it best to create two forms one for new entries adn one for editing or is it best to add a command button on form for editing.
Code: Private Sub Form_BeforeUpdate(Cancel As Integer)
' This procedure checks to see if the data on the form has ' changed. If the data has changed, the procedure prompts the ' user to continue with the save operation or to cancel it. Then ' the action that triggered the BeforeUpdate event is completed.
Dim Ctl As Control
On Error GoTo Err_BeforeUpdate
[code]....
THis code avoids a form being closed if a required field (with tag "*") is not filled. How can I expand it to fields on a subform?Another "issue", how can I personalize the error messages :
1) Can't save record at this time ... (required fields in my table) 2) Multicolumn index causes an error message "Ca't save because of duplicate value in primary key, index ...
I have a table that records a list of dates using the first of the month in short date format (01/01/2011) and I have the following query
Code:
SELECT Format([dateworked],"mmm yyyy") AS Monthyear, Table_dateworked.dateworked FROM Table_dateworked;
This query is the source for a combo box so it stores the actual date but the formatted date is visible.An additional complication (if it has to be) is that I have two combo boxes and I want to make sure the finish date is later than the start date, so I have a similar query which only returns later dates than the start date.
What I would like to do instead is to remove the combo box and to get the user to type in the month and the year in the "MMM YYYY" format, default the day to the first of the month and make it invisible.How difficult would this be? Would it be easier to enter the date in short format and change the format using the after update event?