Remove Controls On A Forms' Opening
Sep 29, 2006
Hi there,
I've been puzzling over this one for a few days. I've done a few searches on here to borrow some code - but the fact is I don't understand how to implement the suggestions. I'm hoping somone can help.
Basically, I have a form for editing the database, however, there are a number of reasons for opening this form - so at the moment I have several copies of the same form all with very minor changes. In order to streamline the way I've done this, I'd rather have controls always call up the same Form - but state in their code whether or not certain controls on the editing form are visible or not...
:mad: :eek: :mad: :eek: :confused:
It's all gone rather Pete Tong here. And I must admit I'm button bashing the code a bit now. Basically, when a button is pressed, I want it to load the form "frmEditJob". Depending on what I want visible, the Tags "N, M and V" will activate and deactivate certain controls on "frmEditJob".
With me? :confused:
Any help is appreciated!
Cheers.
Private Sub EditJob_Click()
On Error GoTo Err_EditJob_Click
Dim stDocName As String
Dim stLinkCriteria As String
If IsNull(Me![IDEntry]) Then
strMsg = "You need to enter a Valid ID number in the box provided."
strTitle = "ID Number Error"
intStyle = vbOKOnly
MsgBox strMsg, intStyle, strTitle
Exit Sub
End If
stDocName = "frmEditJob"
Dim ctl As Control
stLinkCriteria = "[WorkorderID]=" & Me![IDEntry]
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria
If ctl.Properties("Tag") = "N" Then
ctl.Properties("Visible") = False
Else
ctl.Properties("Visible") = True
End If
Exit_EditJob_Click:
Exit Sub
Err_EditJob_Click:
MsgBox Err.Description
Resume Exit_EditJob_Click
End Sub
View Replies
ADVERTISEMENT
Apr 7, 2014
I have a Form opening from Access Options. I would like to close this Form using the Timer. The following is the code I have used but it is not working.
Private Sub Cover_Page_Form_Load()
OpenTimer = Timer
End Sub
Private Sub Cover_Page_Form_Timer()
If (Timer - OpenTime) = 5 Then DoCmd.Close acForm, "Cover_Page_Form", acSaveYes
End Sub
Next question. If I can get this to work can I then use a DoCmd to open new Form within the code above or do I need a new process.
View 5 Replies
View Related
Apr 20, 2006
Hi All,
Is there a way that when the user clicks on a database file, the form pops up without opening MS Access window.
Thx,
Jatz
View 1 Replies
View Related
Apr 20, 2006
Hi All,
Is there a way that when the user clicks on a database file, the form pops up without opening MS Access window.
Thx,
Jatz
View 6 Replies
View Related
Jun 2, 2005
Hello,
I want to use a tab form where the user can click add, search, and edit records all from 3 tabs. The problem is I only want to be able to add data on one form, edit data on another, and just read only on the search. This seems to cause a dilemma, how can I specifiy them to add, edit, and read only on one form using tabs?
Mateo
View 1 Replies
View Related
Oct 31, 2013
I am making a database that will be used by multiple people on a network, and they have different resoloutions on their own computers. when the database is loaded on their respective computers, the form controls are all off.
On the computer i designed them on, the forms fit perfectly on screen, as do the controls, i would like to know if there is some vba code i could incorporate into the form open event, or module code that i can use in order to dynamically re-seize the forms and all of the controls to suit different resoloutions?
View 6 Replies
View Related
Mar 30, 2012
I have a main form, 2 sub forms, and 2 text-boxes on the main form. I have a search box now for the first subform. Works perfectly. Once the users filtered based on name, I want them to be able to select that filtered record which would filter another subform.
Right? ok.
My first attempt was to assign the ID that was selected to a textbox on the main form, then automatically requery the second subform based on that value. I used this way on my search box. I'm sure there is a way to go directly from clicking the value to requerying the second subform, but i don't know it.
That being said even the indirect first attempt isn't working. It all has to do with the ".", "!", and ordering of this stuff. It has to do something with Parent child, but beyond that I'm at a loss.
Code:
Me.[Collateral] = Acct_Reference_id
Me.[Navigation]![textbox] = Acct_Reference_id
...
'Me!Subform1.Form!ControlName
'Me!Subform2.Form!ControlName
'Me.Parent!ControlName
I did find this very useful site [URL] ...... It shows what code you can use depending on where you are and what you're doing. Even with that as a resource, i'm still at a loss.
View 7 Replies
View Related
Apr 28, 2008
Hi,
I'm new to Access and am having trouble designing a database that houses application details.
All applications have a list of unique wrap id's but have different tables housing different details for these wraps.
I have a main table which is for data entry and lets me input whether or not a piece of software is Vista compatible (yes/no) etc.
I also have a field in this table showing which analyst is responsible for researching compatiblity of an application.
I have another table with different regions i.e. london, manchester etc that has the region/city listed as the field heading and then contains a list of wraps used in that city under the relevant field.
My main entry form is linked to the main data entry table that holds specifics for an app, name, vista compatible etc. This form is used for data entry. I want to add a subform on this form which shows a list of all applications, in table format, but I want a drop down list so I can select an analyst name / region so that analysts can update details for a specific area assigned to them. In the table I want all of the records based on this criteria to be displayed.
I guess I need to make a filter button on my subform but do not know how to do this. I put in a button control for apply filter by form but then dont know what to do.
I'm new to access and don't know much VB - e.g. the only thing I can do in VB is a make a message box that says hello world on the screen.
Any help is sincerely appreciated. Apologies for the Essay.
Kind Regards
Bal
View 7 Replies
View Related
Jul 23, 2014
Access 2007
I have a subroutine which cycles through all controls on a form, and for controls with applicable tags, either enables or disables the control.
The routine accepts a form as the parameter (frm), and is called from a button on the form itself.
Despite trying frm.repaint in the generic routine, and, me.repaint from the calling form, the controls do not seem to repaint until the mouse moves over them. A command button, for example, will be grey-ed out, despite being enabled, but will un-grey when the mouse goes over it.
View 8 Replies
View Related
Aug 16, 2013
I have a main form, lets call it FrmMain. In addition, I have a subform on FrmMain that has a tab control on it (frmSubform). What I would like to do is on form load, reference the tab control that is on the subform, loop through the controls/textboxes, lock them and change their backcolor. The code I am attempting is listed below, however, I am getting a "type mismatch error" highlighting this line:
PHP Code:
Set Frm = Forms!frmConsultingMain!FrmConsultingFeeData
Below is my code:
PHP Code:
Dim ctl As ControlDim Frm As FormSet Frm = Forms!frmmain!FrmSubformFor Each ctl In Frm.Controls
If (TypeName(ctl) = "Textbox" Or (TypeName(ctl) = "combobox") Or (TypeName(ctl) = "listbox")) Then
ctl.Value = Null ctl.BackColor = vbYellow ctl.Locked = True End IfNext ctl
View 10 Replies
View Related
Apr 29, 2014
I had never seen this before as I have recently moved from 2003 to 2010. When I create a from using the wizard sometimes the controls are grouped (inside a dashed square) which does not allow me to modify its size and/or position independently.
How can I "ungroup" these control?
View 2 Replies
View Related
Jul 9, 2014
On my data entry Form, I have a Combo Box [Condition] and five tab controls. Each tab has as many as 10 controls on it. The purpose of the Form is to populate a table. My questions are:
1) Do I still need to use a subform on each Tab or leave them as-is? i.e. the 10 controls are on each tab
2) How do I make the value of [Condition] transfer focus to the appropriate tab??
View 14 Replies
View Related
Apr 21, 2013
how to hide all form controls at once like if i have many text box and labels how to make a loop to hide it all at once
View 1 Replies
View Related
Aug 13, 2013
I have a library database with a form called Author and a subform from a junction table. The junction table connects Title/Genre. It's many to many because I usually have a few genres for one book.
This is my problem. I want to add more information to the subtable that is in the junction table. For every record I would like to add also Book Group (I am a member of several groups and want to remember which one I read the book with) and Purchased From.
So I am assuming I have to have 2 lookup controls to be able to add Book Group and Purchased from since neither one is on the junction table (and they both come from tables). Or do I add them to the junction table?
View 3 Replies
View Related
Nov 6, 2013
I have created a form with some boxes on it which include in their body textboxes and labels and combos. I would like to know if it is possible (or if a control exist) to group this items which are inside the box and with a simple box.visible = false to make them all non visible without tagging them or adding code with their names statically to make them non visible. Any link that shows how to move controls in the form in runtime?
I would like to hide some controls and make smaller the form and if user selects a checkbox to show these controls that exist inside a box and grow the form.
View 1 Replies
View Related
May 17, 2014
I cannot link a label with a control. I don't know how it happens, or rather how I do it, but on various forms the label is not linked to the proper control. I try to do it by clicking on the warning popup on the right side and indicate I want to associate the label with the control, but sometimes it just doesn't work. That is, if I set the visibility of the control to True or False depending on the value of another control, the label still appears.
I've looked in the properties of each, but there doesn't seem to be anything there to indicate the link or association. Other than laboriously copying and pasting the label back on the form with the control highlighted, is there any way else to do this?
View 11 Replies
View Related
Oct 23, 2014
In the attached picture has a representation of my setup.
My main form has a listbox search form (taken from this site). The search results populate data in subform1.
In the detail section of main form has subform1 with 3 cascading combo boxes. I have queries set up that run the cascading combo boxes.
In the detail of subform1, I have subform2 with a combo box.
Today I decided to merge my search form and the other forms so I wouldn't have two pages. Everything used to work with no errors - but I can't figure out how to reference everything properly now.
I've tried every combination from here to reference things properly. Somehow, I'm missing something.
View 12 Replies
View Related
Jan 7, 2014
I have a form that uses VBA codes to write all the info from the controls in the form into different relational tables. I was stopped at the point that I wanted to have repeating controls. Collect multiple instances of the same type of data, such as in the case of writing many people's Name, Age and Specialty in the Employees table. How do I do that? What is the VBA code for this task?
View 1 Replies
View Related
Jun 27, 2015
Which option in property window is responsible for group lining up of some controls vertically? how to ungroup them to allow resize one individually. I could not also find option in menu for removing pre-formatting of those controls.
View 3 Replies
View Related
May 8, 2014
I have a form with four pages and subforms on each page. I am having issues with scrolling on pages 2-4. The first page will scroll correctly (to the bottom of the form), but the other pages will not scroll at all. I did enable the scroll bars on the subforms, but they will only scroll to the bottom of the viewable form, not the whole form, which I would prefer. Is there a way to scroll through the whole form on pages 2-4? I tried setting the focus to the form itself, but my code didn't work:
Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)
Me.Parent.FRM_TABLE_TAB_1.SetFocus
End Sub
I would change the form; however, it is designed to look exactly like the actual questionnaire.
View 1 Replies
View Related
Oct 10, 2014
I have a form with 10 text boxes on it. depending on a Case
I would like to change the special effect and backcolor
select case colour()
case red
Me.Txt1.specialeffect = 1
Me.Txt1.backcolor = RGB(256,256,256,)
case green
etc
I'm trying to write something so that i can apply both these settings to any text box easily.
View 1 Replies
View Related
Sep 19, 2014
Is it possible to have a form and dependant on the security level of the user, will depend on what control will appear?
Or can I have the controls there and lock them to a user?
I have a DB of staff directory and I want to lock it so users can only view information, supervisors can edit and admin have full control.
I've done it so far by creating a different form and controls for each level but it a lot of work and queries. Is there a simpler way to do it?
View 6 Replies
View Related
Jan 20, 2014
When using the Forms wizard for a tabular form, is there ANY purpose for the Heading of the Forms to be OVER the Field headings?
I find it annoying, but maybe it is because I don't understand WHY I have to resize it every time, before I can use my field headings on the form
View 5 Replies
View Related
Jul 28, 2015
my form consited of 4 pages and controlled by query (joined 2 tables). I added a new table to the query and another page to the form . This page contains several controls (option, check boxes, combo boxes, text boxes) with source - fields of a new table added to the query. None of the controls on the new page respond.
View 5 Replies
View Related
Aug 11, 2014
I have a form (see attached) and every time someone goes to a different field I would like to change the border to red and when they leave that field to change the border back to the default color. I know I can put the code in for each fields got focus and lost focus section but would rather be able to put the code in once and for it to work for all the fields.
View 12 Replies
View Related
Apr 20, 2013
When I drop a field into a form I'd like to take the Lable Box and put in into the Page Header section and leave the data field or control box in the detail field.Sometimes I have available "Remove Layout" function to split the 2 so I can manipulate them around.
View 3 Replies
View Related