Accessing Subforms From Main Form
Jul 25, 2006
I have two subforms. They are in nice neat grids as access setup for me. Both of these forms should have similar data, based on a upc. What I need to do is turn the text of an entire row to red when there is no matching upc in the other subform. The two problems I cannot figure out is as follows.
1. How can I access the forecolor property of a text box in a subform from the main form?
2. How do I access only one row of data, in the default grid?
Any help would be greatly appriciated.
View Replies
ADVERTISEMENT
Apr 12, 2005
hi
i have a stock control db. when new stock is ordered it updates 'units on orders' field, then when goods are recieved the subform field is updated and this automatically updates the 'units on hand field'.
i then have another subform for stock going in and out, i would like to be able to have the units on hand field as above (which is the main form) automatically updated like is when using the the goods recieved sub form??
not sure if i explained it properly but i can send the structure if that helps?
many thanks
View 1 Replies
View Related
Feb 17, 2006
Hi everyone
I use Access 2003 and have created a form with several subforms which I've placed onto a number of tabs. I'd like to have some of the most recently entered data from the subforms displayed on the main form.
For instance - if one of the subforms details the repairs to my car, in terms of date, items repaired, name of the mechanic and the cost, I'd like the most recent date of repair to be displayed on the main form. I know that I can see it be clicking the "Car Repairs" tab then scrolling down the information, but I'd like to have it displayed for easy viewing. I'm not sure if I'd need to have some VBA to do this or if it can be achieved by, for instance, creating a query to populate the appropriate textbox on the main form.
Thanks for your time and patience!
Juan
View 6 Replies
View Related
Feb 23, 2006
Hi All,
I’m hoping someone can help a very confused newbie :confused:
While I have knowledge in using MSAccess I can honestly say I am well and truly stuck. I have searched the forum, but cannot find anything to help me out … if there is anything I am sorry for re-posting. While there may be helpful responses, they mostly involve code, which I do not know.
I have a Main Form (frmPreApprovedTravel) and numerous Subforms (sfrmFlightRail, sfrmHotel, etc). I have designed my Main Form with tabs and each tab contains staff details, flight, hotel, taxi, etc information.
My problem is that when I go to the next record in my Main Form I want the Subforms (all of them) to go to the next record as well. I know this is possible but having tried to figure it out myself for the last 2 hours, but know I’m still missing something!
I would appreciate any help and thank you in advance for the help and taking the time to read my problem.
View 3 Replies
View Related
Jun 17, 2013
I have a problem in requery function i cant requery a subform from main form.
I have a table say table1 and a tab control say tab1 and in this tab control i have four pages on each there is a subform.
I want to refresh one of these sub-forms field.
View 2 Replies
View Related
Sep 6, 2014
I have a main form with a combo which lists all forms in my database. There is also a button which open all the forms depending on this which I will choose from my combo.
Private Sub Command2_Click()
DoCmd.OpenForm Me.cmbforms
End Sub
Is there any way to open the forms in a subform in my main form?
View 5 Replies
View Related
Aug 2, 2012
My main form was working fine (I could key in data) until I added two subforms. Now the main form will not accept data, but the two sub forms do accept data. I have searched properties of all forms and queries, and I cannot find any suspects.
View 1 Replies
View Related
Feb 5, 2014
I am trying to link two unrelated sub forms to a main form so I am able to query data all at once and make a report that displays all this data at once. I do not know if this is possible. I will tell you to the best of my ability about what I have going on.
My main form is a shift report. The primary key is a auto number ID. The rest of the fields are date, name, shift, vehicle. etc.
The first sub form is area attendance. Field are as follows auto number ID (primary key), report ID(which comes from the main form, linked), the area, and the area attendance.
The second sub form is the event log. Fields are as follows auto number ID (primary key), report ID(which comes from the main form, linked), time in, and events.
My relationship now is simply primary key from the shift report (the autonumber) going to the first and second subforms report ID's.
Problem is I can not query two distinct subforms like this (I realized).
View 1 Replies
View Related
Mar 30, 2005
Hi
I apologise for the newbie type question. However, I am a VB not an Access programmer and the syntax for sub-forms always confuses me! (The FAQ by "SJ McAbney" did not help.)
I have an ADP project (pointing to SQL Server, if it makes any difference) and have implemented a security model based around Active Directory. I use this to set a public variable called "lngSecLevel", the higher it's value the more security the user has.
To impose the security, each form has code similar to the following in the form's open event:
If lngSecLevel = 1 Then
Me.AllowEdits = False
Me.AllowAdditions = False
Me.AllowDeletions = False
ElseIf lngSecLevel = 2 Then
Me.AllowEdits = True
Me.AllowAdditions = True
Me.AllowDeletions = False
ElseIf lngSecLevel = 3 Then
Me.AllowEdits = True
Me.AllowAdditions = True
Me.AllowDeletions = False
ElseIf lngSecLevel >= 4 Then
Me.AllowEdits = True
Me.AllowAdditions = True
Me.AllowDeletions = True
End If
(so "me" obviously is the form)
I have a sub-form "frmFile Damages sub" which is available on multiple forms (i.e. several different and distinct forms, which display the information on the "frmFile Damages sub" sub-form).
The issue is that it is possible for the same user to have different levels of security depending upon which "master" form is displayed (this is a business requirement).
As the sub-form's open event is called before the master form's open event, I cannot just place similar to the following in the sub-form's open event:
Me.AllowEdits = Me.Parent.AllowEdits
Me.AllowAdditions = Me.Parent.AllowAdditions
Me.AllowDeletions = Me.Parent.AllowDeletions
The alternative is to modify the main form's open event with the following code (but after my first snippet):
Me.[frmFile Damages sub].Form.AllowEdits = Me.AllowEdits
Me.[frmFile Damages sub].Form.AllowAdditions = Me.AllowAdditions
Me.[frmFile Damages sub].Form.AllowDeletions = Me.AllowDeletions
However, I cannot get the above to work, irrespective of the use of "!" and ".form".
Any help would be appreciated.
Marcus.
View 2 Replies
View Related
Jun 23, 2014
I have created a database in microsoft access 2010 to show invoices for different customers in different countries. In doing so, I created using a two subforms in a main form. I have used the "country name" to link the subforms to the main form. When I enter new records into the subforms for a specific country, I realized that a duplicate record of an old record are being created in the subforms. What can I do to prevent this from happening? I tried to change the query link between the main form and subform to "invoice number" but the same problem has occurred.
I am novice to microsoft access 2010 ...
View 3 Replies
View Related
Aug 29, 2012
I have a main form and four subforms all of which were created from the tables without queries. The main form pulls employees personal data (never changes). The subforms pull Events attended, Lodging at the event, Family that attended the event and Employee minutia which changes per event. I'd like to have a button on the main form that changes the records in view for all of the subforms at once. This way it is easier for the users and I know that I am view all the pertainent info for event A instead of viewing event A's lodging info with event B's family info.
View 3 Replies
View Related
Jul 28, 2014
I have a main form with multpile tabs - each tab containing a different subform.
Link Master Field: ClientID (field in Master Form)
Link Child Field: Client ID (field in all subforms)
There is another field that all the subforms (continuous type) have: ObligorName. All the subforms are based off of a huge table (subtable) with fields: Obligor Name, Address, Zipcode, City, DOcuments Required, Bank Account Number, etc......
Essentially, the user will fill in the 10 obligor names associated to ONE client on the first subform on the first tab + address + zip code + city.
When the user clicks on the second tab to fill out the next subform, I want all 10 obligor names to be there already, so then they can fill out Documents Required + BAnk Account Number.
If I fill out the first subform and then exit out of the form and then reopen it, the other subforms autofill.
HOWEVER, I dont want to have the user have to do this. It wastes a lot of time. What can I do about this so that the table is automatically updated right away. They are all based on the same table so I do not see why there is so many issues.
View 14 Replies
View Related
May 12, 2014
I have a main form "frmDriverNoticeRecord" with 2 subforms, "frmSubDriverNotice" and "frmSubVehicleRecord"..The main form uses "IncidentID" as the PK. Each form stores data in its own table. The tables are related via IncidentID and there is a 1-many relationship between tblIncident (main) and tblDN (sub) and tblVehicle (sub).
I have a form "frmIncidentLog" displaying records in a table view with a few fields for quick reference and to allow selection of a single record for detailed viewing. I created a command button with the intent to open the "frmDriverNoticeRecord" at the current record. The main form and child link fields appear to be linked correctly; i.e. IncidentID on all three. If I open the form manually it opens and I can use it and search and filter as I want. If I try to open it via the command button It opens a small window asking for the IncidenID, when I enter theIncidentID number, it opens the form to the first record every time.Here is the code:
Private Sub comOpenDR_Click()
Dim frmName As String
Dim recID As String
frmName = "frmDriverNoticeRecord"
recID = "[IncidentID]=" & Me![IncidentID]
DoCmd.OpenForm frmName, , , recID
End Sub
I tried running the the DoCmd.OpenForm command directly from the button using the where condition (in various manners) with the same results.
View 13 Replies
View Related
Jul 6, 2013
I am attempting to create a patient tracking database for a clinic I work in and I am stuck at one small but major part.
I have a parent form called frm_Patient_index. On this form you can enter patient details such as personal details, observations ect. I need to create a lab request form for certain tests to be performed.
I want so that a button on the frm_patient_index form opens a subform where the relevent tests can be requested via tick boxes. Now here is my problem I have managed to create all of that except for the information to be entered into the frm_lab_request automatically and get SAVED to its corresponding table. It will not save for me.
I can get the information such as Badge Number, First Name, Surname and DOB to all enter into the fields automatically but getting them to save to the table is not happening.
View 3 Replies
View Related
Apr 24, 2013
Trying to get a total on main form from records from two subforms.
I'm coming up with Run-Time error 2450 Microsoft Access cannot find the referenced form 'tblitemlist subform'.
View 3 Replies
View Related
Jun 11, 2015
I have an access form (Customer) along with a sub-form (Work_done). On sub-form I have Running sum of Amount in Text box-1. I want that Total of Running sum be replaced with Main form's tables field total_amount. Is it possible that we can replace an amount of control of sub-form into main form's field?
View 1 Replies
View Related
Apr 2, 2008
Hi there guys,
Im in a bit of a predicament, I have a main form with 3 subforms named:
Debit/Cred income for day subform
Cheque income for day subform
PDC income for day subform
and in each of these subforms, I have a field/text box (From a query) which is called "SumOfTotal Cost"
and also in the mainform I have another field/text box called "text73"
Now, all I wanted to simply do was to add all of those fields mentioned together to display them on the main form in another text box as a total so I tried to use this expression in the control source:
=Me!Text73+Me![Debit/Cred income for day subform].Form![SumOfTotal Cost]+Me![Cheque income for day subform].Form![SumOfTotal Cost]+Me![PDC income for day subform].Form![SumOfTotal Cost]
But when i open the form, the text box just appears saying
"#Name?"
I then tried to put brackets at the ends of the code, but still nothing would work, I then tried to access each individual "SumOfTotal Cost" by putting the following in a text box:
=Forms![Cheque Income For Day subform]![SumOfTotal Cost]
but it still comes up with "#Name?".
I am pretty annoyed and I would really appreciate it if someone could please help me
Thanks a lot
View 14 Replies
View Related
Jun 24, 2015
I have a database with a Main Menu Form, containing a Button that loads my main data entry form. When the Button is Clicked portions of the data entry form that is loading shows through the Main Form Background (e.g. portions of the navigation bars, and portions of the boarder on the form that is loading.)
View 5 Replies
View Related
Feb 4, 2006
I forum could someone tell me:
I have an unbound form on that form I want to put three sub forms one on a products table the other on a course start dates table and the link table that joins the other two together. all three are related to each other with Pk/FK links.
When I try to link them it says you cannot link items on an unbound form.
regards in advance
Peter:eek:
View 1 Replies
View Related
Dec 1, 2005
I have a subform which makes a change to a field on the main form. When focus is returned to the main form, the BeforeUpdate and AfterUpdate events fire. Why? I thought from the form's perspective, the subform is just another control.
BTW, I get the same behavior if I modify the field from within the Exit event of the subform control.
In either case, the main form's Dirty event is NOT triggered.
View 2 Replies
View Related
Aug 11, 2015
I have my application split, BE and FE. This is a form with a subform.For both I have the properties set to
Data Entry NO
Allow additions NO
Allow Deletions NO
Allow Edits NO
anyone person can open the form, but when a second person tries to open the same form we get the standard, locked by user or user does not have permission.If user 1 logs out then user 2 can get in. So it seems not a permission issue but some setting I have wrong. maybe at the query or table level?
View 6 Replies
View Related
Dec 1, 2005
I currently am trying to do this:
dim a as form
a = me.form
I get the following error: "Invalid use of property"
Is there a function that lets you select a form using its name.
eg: makeactiveform("NameOftheForm")
Or alternatively if there is a function that gets the activeform. (it's for use in a module)
I you can help me Thank you!
View 2 Replies
View Related
Feb 17, 2005
Hi,
I have developed a small database with 3 or 4 forms which works ok on most PC's. But when I put it on a certain PC, it almost works properly except for one form which is very slow accessing the table!
Eg. It could take 2 minutes to use a combobox.
All PC's have Access 2000.
Would there be a reason for this?
Is this an access problem or a PC problem? Are there special settings that I'm unaware of?
Thanks in advance
View 1 Replies
View Related
Dec 6, 2012
I'm working with a form (MainF) ... which has a subform (MainSubF). The subform has buttons that link you to other forms. When you click on one of those buttons, I have a control number that links the two forms by putting a CTR field into the linked form with a ctr defaul that = forms!mainf!ctr.
My problem is that I'd like to use this subform on other forms. However, if I put the subform onto another form such as "MainTwo", none of the buttons on the subform will work because the path is now wrong. Is there a generic way to connect the buttons to whatever form the subform is attached to??
View 6 Replies
View Related
Jan 11, 2008
I am having a problem restricting a user from a certain form.
I have a module that detects if a user or admin based on the roles entered in the employees table.
If their windows login is not listed in the employees table, they will not be able to view any of the forms.
Here's my problem, I want the users to access the switchboard, but they should not be able to get into the reporting button.
here's my code:
If LOAStatusbtn.Caption = "View Report" _
And Not admin _
Then
'useraccess denied because not an admin
error_text = "You do not have privileges to access this screen." & vbCr & "Please contact an administrator"
MsgBox error_text, , "No Privileges"
End If
If they click on LOAStatusbtn and their role is not admin, then a message should pop up.
I searched the forum and could not find anything similar to this.
Thank you,
View 4 Replies
View Related
Jun 13, 2005
I have a form containing a subform.
Inside the form, i set up a button. Inside the OnClick code of this button, i need to access the information inside the subform.
To access the info inside the form, i know:
Me.Fieldname
But inside the subform, i have tried:
Me.SubformName.FieldName
or
SubformName.FieldName
And both did not work.
How can i?
View 2 Replies
View Related