Controls On Subform Disappear
Mar 31, 2005
Well this is going to take a bit of explaining, because my colleagues and I are totally baffled.
I have an Access 2000 front end connected to a Sql production server. I went to make some changes to my forms and subforms, but I did not want to do it with the live data. So I made a copy of the database to my own Sql server on my desktop. So far so good . . . Now when I opened my main form, my subform appeared, but its controls were invisible--I still had not touched the code.
I looked at all the properties for my form and subforms and it is set to Visible and Display always. Now, even stranger, when I advanced my records, if the subform had data its controls would become visible, and then disappear again when I reached a record that had no data for the subform (the main form and the subform are bound to two seperate tables within my database, all the subform controls are bound as are the majority of the form's controls).
Then I went to the code. Nowhere do I change the Visible related properties within the form/subform code. I decided to put a Stop in the Form_Current code of the subform and see what happens as I advance from record to record. What happened was that when I reached a record with subform data present the stop would be read and I would toggle through the Form_Current code. When I would reach a record with no subform data, the Form_Current code would not be read as evidenced by there being no Stop action.
Anyone have an idea of what's going on? Something gets changed when I connect to my local SQL server. Even when I reconnect to the production server the problem remains. Its like some property changes, although I cannot find it, and it is changed permanently. The only property I play with by code is that I enable the controls of the subform when there is NO data in the subform, and I disable the controls when there is data. This code follows:
Private Sub Form_Current()
On Error GoTo Err_Form_Current
If Me!AssignedNumber = True Then
Me!AssignedNumber.Enabled = False
Me!txtWTNumber.Locked = True
Else
Me!AssignedNumber.Enabled = True
Me!txtWTNumber.Locked = False
End If
Exit_Form_Current:
Exit Sub
Err_Form_Current:
MsgBox Err.Description
Resume Exit_Form_Current
End Sub
Finally I tried to set Visible to true within my code for the individual controls, but that still did not overide the problem. I connect to my server via an ODBC connection to a .dsn.
Thanks in advance for bearing with me,
Tony
View Replies
ADVERTISEMENT
Dec 12, 2014
So I am creating a Complaint Tracking Database with Access 2013. In my 'complaint entry form' I have added to ability to "Open" and "Close" the complaint. While the complaint is open the user is able to enter/edit data in the complaint (new or old). When the complaint is "Closed" (done so with a button on the form that prompts the user to enter a date of their choice) the user should not be able to enter/edit data in the given complaint. In my original thinking, I placed checks on various events (on load, after update, on click) that checked to see if the current complaint had a date in the "Close date" field.
If the close date field was null then that meant that the complaint was open and the the controls would NOT be locked. If the close date field was NOT null (i.e. a date was present) then the complaint was closed and the main form fields were locked but the data was still viewable and unless they "re-opened" the complaint they could not change the data.
Now, in the complaint entry form, I have a subform that acts as a action tracker that is used by the user to keep track of the actions taken on the complaint (i.e. they requested documentation from such and such on this date..etc). My problem through all of this is upon closing the complaint and locking the main form controls, my subforms data just vanishes! At first I figured the problem might be with the linking of master and child fields, so I made sure that I left the ID in the main form unlocked when I loop through my controls during the locking process. This did not solve my problem. Code below:
Private Sub Form_Load()
Dim ctl As Control
If Not IsNull(Me.close_date) Then
Me.FormHeader.Visible = True
Me.btnClosed.Enabled = False
Me.btnOpen.Enabled = True
For Each ctl In Me.Controls
[Code] .....
View 3 Replies
View Related
Apr 15, 2014
I have a form with four unlinked sub forms on - I am hoping to
1) add a value from one subform to another and more importantly
2) update 1 subform when the other is amended...how exactly do I reference subform 2 from subform1.
I have tried me.parent!form2 and forms!mainform!form2.requery etc but can't get it right
View 7 Replies
View Related
Feb 16, 2007
Hello,
I need some help with a piece of code for a db.
This code checks to see if the last three characters on a ControlSource.Tag property are "Req" and if they are, tests if it's null or = 0 and if it is then it outputs a msg box stating that the control.ControlSource is required. It does it for every control on the main form.
This has worked.
Now, i need to allow for multiple subforms to be located on the main form along with their controls being tested as well. I want to start another loop for each time the conrol on the mainform is a subform.
I have that done so far by using "If TypeOf ctl Is SubForm Then..."
This is the part i need help with. I want to search all of the controls on the subform when it is a subform. I need to search all of the controls on the subform then, and i'm not quite sure of the syntax.
I've tried various somethings like SUBFORMCONTROL.Controls but that hasn't seemed to work...
If someone could help me, that would be wonderful!
View 4 Replies
View Related
Jan 24, 2005
Hello,
my problem looks so stupid, but I'm not able to solve it..
I've a form with two subforms in it and one of them is behaving in a strange way.
I open the form and type something in a text box in the form. Now I can type something else in a text box in the first subform but I'm not able to write anything in a textbox in subform n°2. It's textboxes (and also other controls like combo,...) look like they are not enabled (but they are enabled!!).
This subform has also got a Button, and it works (It deletes current record).
If I close the form and reopen it and I go straight to subform n°2, now I'm able to insert text in it's controls, but I'm not able to edit the controls in the main form and in subform n°1.
I hope my problem is clear
Please help!!
View 1 Replies
View Related
Jul 13, 2006
I have a subform (in form view) in a form that is used for data entry. When I open the form the subform is blank except for the navigation controls. The navigation controls are disabled though. If I switch to datasheet view I will see the column headers but there won't be any place to type data (no white boxes). This doesn't happen if my master and child fields aren't set up, but obviously that will show the wrong data and create other kinds of entry problems. Right now the tables are empty so that could be part of the problem, but I shouldn't have to manually enter a record so my form will look right.
View 12 Replies
View Related
Jan 26, 2005
Hi,
I have two subForms on separate pages of a Tab Control on a main form. I want to create a Textbox on one Form to display the month of a Date field on another form, using DatePart.
Using the On Current event, this works ok, if I have the 'other' subForm open in its own right, but I get message telling me it can't be found if i don't. Here is what I have...
Private Sub Form_Current()
If Not IsNull(Forms![Reviews]!SelectLessee) Then
Dim revDate As Date
revDate = Forms![subReviewPEST]!DateOfNextCreditReview
Me.Text118.Value = DatePart("m", revDate)
End If
End Sub
What syntax do I need, or how then can I access the control without having the subForm open itself, by getting to the page on the tab control, then to the control on the subform...
View 2 Replies
View Related
May 19, 2006
I have a form with 3 tabs...each tab has the same subform embedded in it.
There are 3 sequential records in the database, and my desire is to have each record display on its' proper tab.
How can I set filter criteria for each subform to append the record sequence identifier to the link master/child fields to ensure that only the appropriate record displays on each tab?
Basically, I trying to use tab controls with embedded subforms to display the many side of a one to many relationship. The parent form contains the data for the parentrecord, and I want the subform, with a tab for each related record, to show the child side of the data relationship. One child record per tab, utilizing the same identical sub-form for each.
View 1 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
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
Oct 1, 2015
I have some controls that I want to line up. Some are on the main form and some are on a subform. My questions is how do I do it? I normally
Select all of the controls then click on align and align top and left. Will that work here?
Again some controls on main and rest on subform.
View 3 Replies
View Related
Jun 20, 2013
I have a sub form that allows users to add staff to a project team, once added it populates a table which updates the subform showing the selected employee. I am trying to enable a delete function that allows users to remove an employee from the project team in the subform showing selected staff. Here is the code I have so far, but it doesn't work;
Code:
Private Sub Command4_Click()
Dim dbs As Database
Dim rs As Recordset
Dim sqlstr As String
Set dbs = CurrentDb
sqlstr = "DELETE tbl_CapexStaff.* FROM tbl_CapexStaff WHERE CAP_ID = Forms!frm_Switchboard.CAP_Live"
dbs.Execute (sqlstr)
End Sub
View 4 Replies
View Related
Aug 28, 2013
I have a continuous subform with multiple controls (textboxes) per row.
I'm trying to set up conditional formatting such that certain textboxes are highlighted based on comparisons with other textboxes within the same row/record.
What's bothering me is, I have managed it for one, but struggling to do it for others!
For example - I want to highlight 'similar' records (i.e. possible duplications) - and have managed this by adding a textbox across the length of the row and applying the following CF expression :
Quote:
DCount("[ID]","[tblMyTable]","[ID] <> " & "txtID" & " And [Field1]=" & "txtField1" & " And [Field2]=" & "txtField2" & " And [Field3]=" & "txtField3" & " And [Field4]=" & "txtField4" & " And [Field5]=" & "txtField5")>0
Works brilliantly - highlights all records where fields 1 thru 5 hold common values.
Now I want to highlight where two fields within the same record are different (i.e. they are driven by different data but should hold the same value)
Am trying this :
Quote:
"txtField3"<>"txtField4"
But it's not working - it's highlighting pairs of fields even though they do hold the same value.
Even tried switching it for a DLookup (which seems like doubling up on effort, but just to see if it worked)
Quote:
DLookUp("[Field3]","[tblMyTable]","[ID]=" & "txtID")<>DLookUp("[Field4]","[tblMyTable]","[ID]=" & "txtID")
But no dice? I can't figure out why the same basic logic which works so well for the first CF, doesn't hold for the second one.
View 5 Replies
View Related
Jun 2, 2014
I have placed an unbound subform on a form. I have the following code which loads in different datasheet to the subform:
'Loads in NewQuery
Me.data.SourceObject = "query.NewQuery"
'Loads in NewQuery2
Me.data.SourceObject = "query.NewQuery2"
etc.... this works fine to show these queries but i want to know how to reference the fields on the datasheet.
for example one of the fields in NewQuery is "ID"... When clicked i want to run code... normally on bound subform i could go for example ID_Click()... msgbox(me.ID)
how can i reference these other fields on unbound???
View 3 Replies
View Related
Mar 14, 2014
I have a subform which lists a set of records. In the footer section of the subform, I have a number of controls which display calculations based on the records present.
The number of records in the subform will change (reduce). Basically, this is a review / approval function, the idea being that each record will be checked and approved, which will then remove it from the list.
So eventually, all of the records in the subform should disappear (the subform is requeried each time the user approves a record)
I want to be able to hide the controls in the footer section once the subform has been cleared of all records.
But not sure
a) how to determine when the subform's recordset reaches zero and
b) what event to use to fire the code to hide the footer controls.
This is my basic attempt :
Code:
Private Sub Form_Current()Dim ctl As Control
For Each ctl In Me.FormFooter.Controls
ctl.Visible = Not (Me.Recordset.EOF)
Next ctl
End Sub
But it doesn't work (it only seems to fire when the subform is loaded, not when it is requeried after each approval?)
I've tried Form_Query, Form_DataChange and Form_DataSetChange but no joy with those either.
View 6 Replies
View Related
Jun 13, 2005
Hello,
I have a form and a subform in MS Access 2003. I have made some changes to database structure, so I decided to change the subform also. When I changed the Link child and link master fields, the controls of the subdatasheet dissapear- they show only in design view. If I clear the contents of Link child and link master fields they appear again, but the records are not binded.
Is there a setting on the parent form that also has to be changed, to make the new binding?
Thanks,
Aleksander
View 1 Replies
View Related
Jul 11, 2006
Hi all
I am trying to give a new user access to the front end of a DB.
When I copy the FE from the server to the local C drive ( Windows XP)
the FE loses all its relationships and the user is not able to query anything.
I go back to the server and find that the FE is just fine on the file server.
I also tried running the FE from my PC ( Windows 2000 SP4) and it works fine.
Do any of you know what the issue could be.
I also checked to see that the new user has permissions on the folder on which the file is located on the server and she does...
Any thoughts on what the problem could be would be highly appreciated.
Thanks.
View 4 Replies
View Related
Oct 27, 2006
Recently
I have noticed that the "warnings" in my access 200o database no longer pop up. As example, if I went to delete a table or record, I used to get a pop up warning from MS Access asking for confirmation. Now the record just deletes without a warning. This seems to be happening with other things too.
Any thoughts ???
Thanks
Jackson:eek:
View 3 Replies
View Related
Feb 17, 2006
Hi, I am new to access and I have found important tricks in this forum. Thanks to everybody
Now, I am trying to use a query with multiple criteria. In particular it has to query a table that contains info about candidates tblCands using text boxes, check boxes etc etc present in a form.
First, it works correctly but if I close the form and re-run it, statements in query disappear.
Could someone indicate me what would be the problem?
Thanks in advance
View 2 Replies
View Related
Feb 27, 2008
Sometimes when I send a copy of an Access 2003 application to a remote user, a stored procedure or function will disappear. What causes this, and how can I get the entire application over to the users?
Thanks in advance!
View 6 Replies
View Related
Jun 3, 2015
I use Access2007 under Windows 8.1 64 bits.Just ignore any message related to a splash form.The form will register revenues in the table TblLanc Receita sPJ. When either saving record input or closing the form, incomplete records must be eliminated from the table. When opening the form you should be able to see the unbound list of revenue inputs made. The list will show empty though because the last time I closed the form thru the button Close, table data disappears. Also, the same happens if I get into the form design mode to analyze the code and re-execute the form.
Please, click on the button Add to input a couple of revenue records thru the form to verify what I just said.I translated relevant input fields so the input should not be a problem. Fields named Quotation, Direct Purchase, and Contract, can be filled in with any data... just make sure only one of these fields per record be input, otherwise you'll get a pokayoke message. Save each input. After 2 or 3 record inputs, close the form and re-open it. Table will be empty. Redo and save new inputs. Go to the form design mode just because. Re-execute the form. Table will be empty again.
Another point is I want to click on a record of the unbound list and have the clicked record fields properly filled in the form. From that point I would decide if the record would be deleted or changed. The functionality of the entire code works but the selection on the list. In other words I do not understand why I am not able to fill in the form with the selected record fields. My code should do that but it does not.
View 1 Replies
View Related
Apr 12, 2007
Hi
I am using MS Access 2003. I would like to setup table link to sqlServer 2005.
sql server and access 2003 is in on the same pc. I have setup ODBC Data source to this sqlServer database. I tested the setup and it work fine.
Then I go to access and action; File/Get External Data/Link Tables.
On lick Link Tables, It open link popup windows. But when I select ODBC Databases() from the Files of Types dropdown, windows disappeared.
It doesn't open odbc datasource windows.
Please could you help to solve this problem.
many thank
View 1 Replies
View Related
Apr 4, 2006
hi all,
Is there a way to make message box disappear automatically after few seconds....
Thx,
Jatz
View 2 Replies
View Related
Oct 2, 2007
Hi,
My property sheet has disappeared I don't know what I did. How can I make it reappears? I have try by pressing the SHFIT key but it won't work. Also, I have created a new database and open it, the property sheet isn't appeared. The icon are still there but when I press on it, it does not response.
Thanks,
Le
View 10 Replies
View Related
Sep 13, 2006
Hello Access experts,
I am using MSAccess 2002. I have removed the tables and queries to reduce file size. I have set database password as "planning". In the form named "Form1" I have created a Shift-Key Enable/Disable button with password "SIMON". In Menu Starup, I have also disallowed Display Database Window, disallowed Built-in Toolbars and disallowed Toolbar/Menu Changes. Now I have problem because I cant unset the Security password and make changes in Startup.. because the Menu Tool/Security, Startup..etc have disappeared. How do I get them back again?
Thanks in advance.
View 2 Replies
View Related
Aug 28, 2005
hey, i hav seen a similar thread about this (i think bout a year ago or so) and i didnt no whether to continue it or start a new thread.Option boxes - Making items visible
that thread did not fully answer my question and after searchin around n finding nuthin i hav decided to ask
in my form i have the payment methods=> cash, cheque, credit. i did have these in a drop down menu, but i wasnt sure how to do what i wanted...which is based on the selection either make a couple of fields (credit card details etc) visible or invisible. so what i have done is changed the drop down list into an option group with radio buttons.
i currently have this coding
Code:Private Sub Frame_Click()If Me.Frame.Value = 3 ThenMe.CardHolder_Name.Visible = TrueMe.Credit_Card_Number.Visible = TrueMe.Expiry_Date.Visible = TrueMe.Type.Visible = TrueElseIf Me.Frame.Value = 2 ThenMe.CardHolder_Name.Visible = FalseMe.Credit_Card_Number.Visible = FalseMe.Expiry_Date.Visible = FalseMe.Type.Visible = FalseElseIf Me.Frame.Value = 1 ThenMe.CardHolder_Name.Visible = FalseMe.Credit_Card_Number.Visible = FalseMe.Expiry_Date.Visible = FalseMe.Type.Visible = FalseExit SubEnd IfEnd Sub
this seems to work although say if my first record has credit card selected, then all the fields are visible, but wen i move onto the next record which is cash or cheque...they are still visible until i reselect cash or credit again..(and vice versa)
i hope this makes sense :P
thanks
View 3 Replies
View Related