I have a split form in Access 2013. I have a checkbox in the top frame that if checked a textbox becomes visible. However, if I click on a different record and check the box and go back to the previous record, the textbox becomes invisible even though the checkbox is checked.
My code for the checkbox is
Private Sub chkPhoneChange_Click()
If chkPhoneChange.Value = True Then
lblNewPhoneNumber.Visible = True
txtUpdatedNumber.Visible = True
Else: If chkPhoneChange.Value = False Then lblNewPhoneNumber.Visible = False
txtUpdatedNumber.Visible = False
txtUpdatedNumber.Value = ""
End If
We have a database with one main data entry which stores records in a seperate table. There are several thousand records keyed in using this form. Therefore, alongside the entry we have a search form which allow the user to search for a specific record and display it in the main if he/she needs to edit one.
We have received a request from users for a functionality which allows users to browse all records, using the main form layout, that they have keyed in. I guess what I am asking is: Is there a way to limit the records visible in a form using field on that same form as a limitation (ie. the users name - which is a required key-in)?
I know there have been a good number of questions about visibility in forms already but I couldn't find a solution to my problem (or maybe I just didn't get it).
Basically, I have a tabular form (more than one record displayed at once) and one the field is of the Yes/No type. For each record, I'd like to have a text box that displays 'pending', set as visible if the field value is 'Yes' and set as invisible if the field value is 'No'. The table is as follows: id : auto-number Flag: Yes/No [Yes]
If I use the following code on the Flag button: Private Sub Flag_AfterUpdate() Me.pending2.Visible = Me.Flag.Value End Sub
all the 'pending' text boxes appear and disappear together (instead of just the relevant one). I thought of using another text box, with the same data source ('Flag') but which would set itself to visible or invisible wrt to its own value but I couldn't find a way to do it.
Any suggestions ? Thanks in advance ! and many thanks already for the forum and the contributions - it's been extremely helpful, esp. for a beginner.
I am running Access 2003 and have created a split form using one of the std form options. The file it is querying has about 20 fields per record. The split form that is generated has four columns of 10 fields each.
E.g. Column 1 Column 2 Column 3 Column 4
Employee Fred Smith Weekending 24-June-2013 Age 25 Hourly_Rate $30.00 Normal_Time 24 Sick_Leave 8 Vacation_Hrs 8 Total_Hrs 40 etc etc Field10_Name, Field10 Contents, Field20_Name, Field20 Contents
When I view the form generated, some of these fields are too narrow and others are too wide. I would like to make the width of the fields various widths. But if I try to widen one field in the column all fields in the same column are made the same width. It appears as if they are multiply selected. Is there any way of selecting a single field and varying the width without impacting fields above or below it in the column?
I have a split form on my database where I have my combo boxes bound to a primary key but they display the description field so it's much easier to understand. Is there a way to do this with option groups? In other words, I would like the datasheet part to display the option group labels rather than the values so it is easier to understand.
I have a combobox on my form called TypeOfBusiness, with fields including Corporation, Education, Industry, Non-Profit. In order to make a second combobox called IndustryClassification appear when Industry is selected from the TypeOfBusiness combobox, I have used the following code:
Code: Private Sub Form_Current() If Me.TypeOfBusiness = "Industry" Then Me.IndustryClassification.Visible = True Else Me.IndustryClassification.Visible = False
[Code] .....
It works just fine. However, when a user selects both, say, Industry and Education, the IndustryClassification combobox will not appear. What code I can use to ensure the IndustryClassification box will appear regardless if another box is checked in addition to Industry? I am wondering if it has to do with the Column attribute.
I have a Main Form with a Sub-Form, the sub-form is base off a query. on the sub-form i have 8 controls, one of them is "Status' and "Process" and "Review" My Main Form have a Refresh command that refreshes the data in the sub-form.
What i am trying to do is make the "Process" Control only visible is "Status" is a certain status and "Review" visible if "Status" is something else. what i have done works correctly On Open. I run into and issue on the refresh command. I get Run-time error '2165' "You can't hide a control that has the focus"
Code: If Forms!Main_Form.[Name subform]!Status = "Ready" Then Forms!Main_Form.[Name subform]!Process.Visible = True Forms!Main_Form.[Name subform]!Review.Visible = False ElseIf Forms!Main_Form.[Name subform]!Status = "Reviewing" Then Forms!Main_Form.[Name subform]!Review.Visible = True Forms!Main_Form.[Name subform]!Process.Visible = False End If
I have done similar with a main form and making sub-form visible or not based on a control on a main form and that has worked perfectly. I am not sure how the control is getting focus and cause the error.
I have a form with a subform. I would like to make a field on the subform not visible if a field on the primary field is null. Can anyone help? Thanks.
I have 30 fields on a form that houses codes that are 1 to 2 digits in length. Some of those codes are used way more often than others so I decided to build a VBA script to apply the most common codes to the fields based on entry in 3 other fields and applied to a button. The code works great but one of the fields (the 6th one) is behaving oddly. I have tried multiple criteria for code and it is ONLY the 6th field being the pain. The code is applied to the field but it is invisible until that field gains focus by either clicking on it or tabbing to it. I checked the fields format to others of the 30 and all of the settings are exactly the same. There is not anything set in any of the events and there is not any other code pointing at those fields.
When opening the main form I would like to create a macro that is able to set the property visible/not visible for a certain field if a certain condition on another field is satisfied. I Have Office 2010 and with the macro editor I'm not able to make it work. Need writing the text as in the macro editor?
Here below the example:
Main form name: FORM_1 Subform name: SUBFORM_2 Subform field: FIELD_ABC Subform field: FIELD_123 Subform field: FIELD_CHECK
Opening the form FORM_1, the macro must show the field FIELD_ABC and hide the field FIELD_123 only if FIELD_CHECK is equal to "TEXT OK" ...and the macro must hide the field FIELD_ABC and show the field FIELD_123 only if the field FIELD_CHECK is equal to "TEXT WRONG".
I've got a memo field on a form where the name is TextEXTRA
The Control Source for TextEXTRA is EXTRA.
I've got a box called BoxSHOW (Visible = No)
As I browse through records or find records, I want the box to become visible when there is something in the EXTRA field and become invisible when the EXTRA field is empty. This is what I've tried .....
Private Sub Form_Current() If EXTRA Is Not Null Then BoxSHOW.Visible = True End If End Sub
I tried many variations on the first line such as ...
I have a form with four subforms set up in a tabs on the form. In the subforms I have a copuple of command buttons which enable/make visible fields when they are clicked (see previous posts but for eg) - if a height and a weight are added in two separate boxes a calculation is done and then a command button pressed to make visible the (label) which shows the mass index the patient falls into. My problem is that the label is then retained so if I click out of the form and re-enter with a new patient then the height and weight boxes are clear but the label from the previous patient remains.
I tried to put the code Private Sub Form_Load() If PtWeight = Null And PtHeight = Null And Text60 = Null Then Label106.Visible = False Label101.Visible = False Label177.Visible = False Label122.Visible = False Label123.Visible = False End If End Sub in both the open and on load event of the main form (not the subform) but it doesn't help. Any ideas?
(When should code be put on the main form and when on the subform?)
Imagine that you see a column of values and then a total at the bottom. The only issue is that the total value does not appear until you click on it.
Any setting that would cause a total value in a footer section to not appear automatically?
Behavior is noticed on reports as well as subreports. An image is attached.. Imagine the $37,000,000 simply not appearing until it is clicked with the mouse.
I am having a problem with making a textbox visible on a form if a checkbox is checked on the same form. I have done research on this site and have written the code below, but I am getting a Syntax error, see yellow highlight.
- My checkbox is named: Case is a Readmission from WRCA IP to WRCA IP - My textbox is named: Date of Current IP Admission (I have defaulted this textbox to not visible).
Here's the code I have written:
Private Sub Case_is_a_Readmission_from_WRCA_IP_to_WRCA_IP_Clic k() If Case is a Readmission from WRCA IP to WRCA IP =true then Date of Current IP Admission.visible=true Else Date of Current IP Admission.visible=false
I have a Lost/Found property database which we use to keep record of the lost/found property and it is working fine.
As per our organization's policy, we keep the item(s) for up to three months in which if it gets restored to the owner then fair enough otherwise after three months the item(s) can be claimed by the "Finder". But for this very purpose we issue the Finder with a "Claim Receipt" which he/she should bring in when claiming for the item(s) after three months period. Therefore, It's just the right time to upgrade the database to a more professional level.
The database has one table and two forms.
One form (LostFoundForm) is visible to the user in which they enter data, this form has two sections; Item(s) & Finder's details and the second section is about Restoring details.
However the second form (ClaimReceiptForm) is hidden to the users (for manual data entry) and has only one section which is exactly the same as the first form's first section, i.e., Item(s) & Finder's details. This second form takes the data automatically from the first form because the table behind them is same and fields are same (please see attachment). Up to here it's all working fine.
I would like to introduce a Checkbox or a CommandButton in the LostFoundForm which when we click should pull up a msgbox asking "Do you want to print the receipt for this item(s)?" with a Yes/No option. On clicking "No" it should, obviously, settle down but on clicking "Yes" it should print the "corresponding record" from the ClaimReceiptForm.
I created a little form containing informations the users need to see to insert the right values in other forms. I need to have this little form always visible even if the users are working with another form maximized. Does it exist a code to do it?
Greetings. I have three forms that are open at the same time. They are related and cascading. The first form (frmEventAdd) is the anchor. Each event can have many Trials. The second form is frmTrialInfo. Each Trial can have three Classes. The third form is frmClassInfo. These forms are used for update and adding new records.
The user displays an event for update (frmEventAdd). Then clicks on a button to display the Trials for that event (opens frmTrialInfo). frmTrialInfo displays information for one Trial at a time. The user clicks on a button to display class information for that trial (frmClassInfo).
One of the fields on frmClassInfo is called cboJudge. It's a combobox with names of Judges (judges of dog competitions). The judge information in the combobox comes from two tables: tblPeople and tblJudges. If the user wants to add a new judge they may click on the btnNewJudge. btnNewJudge will open a form that is used to add a new person (frmPeople).
Because frmPeople is opened from many different points in the application, I found it easier to simply make the three, already opened, forms INVISIBLE. So...command button btnNewJudge opens frmPeople and makes frmEventAdd, frmTrialInfo, and frmClassInfo INVISIBLE.
When frmPeople is closed (btnClose), it checks to see if each of the previously opened/visible windows is open and then makes each VISIBLE, again. frmEventAdd and frmTrialInfo reappear just fine. However frmClassInfo does not.
I have traced the btnClose_Click routine in frmPeople and it certainly looks like every line of code is being hit, but the line that should make frmClassInfo visible does not do anything (nor does it generate any error).
Here is the code from btnClose_Click in frmPeople. Can you help me?
********************************************
Private Sub btnClose_Click() On Error GoTo Err_btnClose_Click
Dim blnEventAdd_Open As Boolean Dim blnTrialInfo_Open As Boolean Dim blnClassInfo_Open As Boolean
blnSecondChance = False
If blnDataChanged = True Then If DataHasChanged() = vbYes Then Call btnSave_Click End If End If
'================================================= ======================================= 'blnSecondChance=False = NO SECOND CHANCE ... Close this Form 'blnSecondChance=True = USER GETS A SECOND CHANCE ... Do NOT Close this Form '================================================= ======================================= If blnSecondChance = False Then 'Zero out Relative Record Number from Array svRecNo(intCallerIX) = 0 blnDoUpdate = False blnDataChanged = False DoCmd.Close acForm, Me.Name
'Is the frmEventAdd form open? blnEventAdd_Open = SysCmd(acSysCmdGetObjectState, acForm, "frmEventAdd") And _ acObjStateOpen
'Is the frmTrialInfo form open? blnTrialInfo_Open = SysCmd(acSysCmdGetObjectState, acForm, "frmTrialInfo") And _ acObjStateOpen
'Is the frmClassInfo form open? blnClassInfo_Open = SysCmd(acSysCmdGetObjectState, acForm, "frmClassInfo") And _ acObjStateOpen
If blnEventAdd_Open Or blnTrialInfo_Open Or blnClassInfo_Open Then If blnEventAdd_Open Then Forms("frmEventAdd").Visible = True Forms("frmEventAdd")!cboContact.Requery Forms("frmEventAdd")!cboSecretary.Requery End If
If blnTrialInfo_Open Then Forms("frmTrialInfo").Visible = True Forms("frmTrialInfo")!cboTrialRep.Requery End If
If blnClassInfo_Open Then Forms("frmClassInfo").Visible = True Forms("frmClassInfo")!cboJudge.Requery End If
intCallerIX = intCallerIX - 1 Else DoCmd.OpenForm PopCaller(), acNormal End If End If
I have a table that holds 250 records, and dont really want to split manually as the saving grace is that each record, has a hyphen that marks the point where the split needs to take place.
For example, the field currently holds
'Movicol sachets - 1 or 2 sachets dissolved in water at 21.30'
That is stored in 1 field, I now need to be stored in to 2 fields, whilst removing the hyphen, and spacing immediately before and after so it works out like this.
Field 1 = Movicol sachets Field 2 = 1 or 2 sachets dissolved in water at 21.30
I know it can be done using either a query or VBA, but I am not sure which function/procedure/command I need to use to carry this out. Any assistance would be gratefully recieved.
A pre-existing table was created with lastname, firstname contained in one field. I would like to create a new table with a separate field for lname & fname. Is there a way to take the existing names and put them in separate fields? (Some contain a middle initial as well)