Forms :: Which Tab Is Subform Opening In
Jun 23, 2014
I have a tab control with 8 tabs, one for each hour in a shift. There is a subform on each tab. Some of the subforms are re-used since they are identical to each other (there is a 1,5 form, a 3,7 form and a 2,4,6,8, form). I'm looking for a way for the subform to know which tab it is in when it opens. I have some code that I need to run differently depending on which tab the subform is opening in. in other words, on the 3,7 form I have code that I want to run if it is in the Hour 3 tab during hour 3 but not if it is in the Hour 7 tab.
Everything I've tried seems to run into the same problem, since subforms actually load first, it can't see which tab it is on. If the user clicks another tab, it thinks it's still in the previous tab and the wrong code runs. I may have to resort to creating duplicate forms for each hour just to accomodate this. That will increase the form count to 8 from 3 and duplicate effort when making changes.
View Replies
ADVERTISEMENT
Feb 17, 2014
What is the best way to open a linked subform using a button while in a newly created record?
I thought a simple
Code:
docmd.save
command would do (either in the "current record" or the "after update" event)
View 4 Replies
View Related
May 20, 2013
I have a form with a subform. Every time I open the form I want it to open to a new record in the subform (but not necessarily a new record in the main form; that will depend on some other stuff that I've already taken care of).I found a way to do that using the following VBA in the main form:
Private Sub Form_Current()
Me.EventSubform.SetFocus
DoCmd.GoToRecord , , acNewRec
End Sub
It works great, but it causes Access to automatically scroll down to the start of the subform, blocking the view of information in the main form that the user needs to see. I've tried adding a line to Form_Current() to reset the focus to the main form but it doesn't seem to work.
View 5 Replies
View Related
Jan 28, 2014
I have a form that displays details for a specific asset and a continuous subform that lists all the purchases for that asset. I have the following code in the On Click event for one of the fields in the subform:
Dim myOrder As Integer
myOrder = Me.txtOrder
DoCmd.OpenForm "frmOrders", acNormal, , "OrderID=" & Order, acFormEdit, , "Edit"
The problem is, when I click on any item in the subform, the code returns the value of the first item in the form rather than the one clicked on. If I open the subform on its own (outside the main form) then the code works fine. I can't figure out why it won't work in a subform.
View 6 Replies
View Related
Jul 20, 2015
I'm using Access 2007. I have a few problems:
1. I have a switchboard. I want to click a button, that opens a form with a dropdown list, when I make my selection, it opens a subform in add mode, but the linked field in the subform isn't empty, but filled with the mainform's field value that I selected?
OR
2. Is there a way for me to open a form in add mode, add data to it, click the add button (I will add an add button) that allows me to add again, but this time a particular field is not empty, but filled with selected info from previous selection?
Say for instance, I have 2 fields (both combo box fields), I click add, made selections for both fields, I click add again, but this time one of the fields stays constant like it's already been selected. It's filled with what was selected from before.
Either of those 2 - which ever is simpler.
View 4 Replies
View Related
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
Apr 18, 2007
hello,
I have a subform which opens good with Access 2003 but now that I updated to Access 2007, it won't open. It gives me a "type mismatch in expression" error. Why does this happen??
thank you.
View 2 Replies
View Related
Nov 8, 2006
I have a sub-form in a form that displays data that relates to the data in the single form. What I would like to do is double click on that record in the form which then opens a form that displays more of same data in the sub-form. I have created the double click action that opens a form, but shows all the data and not the specific information relating to the record that is selected in the orginal form.
Look forward to any advices
View 1 Replies
View Related
Nov 9, 2011
I have a main from named RequestChecks with two list boxes on it named ListDateii and ListDateiii .Also , there are two subfroms named OperatingAccountII and Operating AccountIII. tHE list boxes have master-child bound relation to the subforms .If user scroll ListDateii and highlight the date , the subfrom shows the resord associated with this date . And the same with ListDateiii. If it is possible, when a user opens the main form RequestChecks, the list boxes show only the date of the last record and consequently the subrofms show the last record.
I put the below code in main form load events
ListDtaeii.SetFocus
ListDtaeii.ListIndex = List0.ListCount - 1
ListDtaeii.Selected(List0.ListCount - 1) = False
ListDtaeiii.SetFocus
ListDtaeiii.ListIndex = List0.ListCount - 1
ListDtaeiii.Selected(List0.ListCount - 1) = False
It doesn't work.
Seond my attemp -I put the code in form current
Private Sub Form_Current()
Dim rs As Recordset
Set rs = OperatingAccountII.Form.RecordsetClone
If rs.RecordCount Then
rs.MoveLast
MySubForm.Form.Bookmark = rs.Bookmark
End If
And doesn't work neither.
View 1 Replies
View Related
Jan 24, 2006
I have 2 combo boxes which I select a 'Year' and an 'Incident'. Based on 'incident', a listbox lists whether it was a 'bad' or 'good' incident.
I only want my subform to pull up the record if the listbox says 'bad'. how do I do that?
View 3 Replies
View Related
May 4, 2006
I have a form (eg. frmMain) with a subform (eg. frmSub).
The subform is going to be a query which displays results based on criteria defined in the main form.
So say frmMain had a field called 'OrderDate'. When they typed an order date, all the orders on that date appear in the subform.
The way I have it set up at the moment is that the query criteria is like [forms]![frmMain]![orderdate]
Do this means that once the order date is entered - there is still no results in the subform because the query has already run when the form was opened and, as this field was then blank, no results were returned.
I would like to keep this setup, but - instead of having the subform set to the query, it would be set to another form which just has a commond button.
The user will then input the OrderDate - click the button (which is in the subform) and the query will run. This can be done easily. HOWEVER, is there a way for the query results to be displayed in that subform area after the button has been clicked instead of opening up a new form.
I know in web design you can target links to frames, so wondered if this was possible?
View 1 Replies
View Related
Sep 30, 2004
The posting in archive t-31918 was very helpful and almost does the trick. I have a subform with gifttype that has only giftID and gifttype. There are four different gift types and I need a subform to open in a specific location, as a subform. The code given by the archive (my version):
Private Sub Gifttype_AfterUpdate()
If Me.[Gifttype] = "restricted/unrestricted" Then
DoCmd.OpenForm "frmgift1"
ElseIf Me.[Gifttype] = "planned gift" Then
DoCmd.OpenForm "frmplannedgift"
End If
...
Opens what I want as subform as a regular form.
How can I get the correct subform to populate a certain area on the master form?
Thank you!
Pat Wright
View 1 Replies
View Related
Apr 16, 2007
Hello,
I'd like to know how to set values to a subform when opening a main form
I have a quotation form called FQuotation with a subform on it.
This subform is the link between the products and quotation it is called SFProdQuote and has the fields: refproduct, quantity, quote and PQTotal.
Once I have filled the info on the main form i pick the products on the subform using a combo box on the refproduct field, input the quantity and give it a quote.
All this works fine it calculates quantity x quote = total.
My issue is I'd like to create a quotation form that opens with a set of products already selected in the subform. let say 10 of them, since my quotations always start with the same 10 products or so. I do not want the users to have to select over and over the same things.
Is it possible to open a form with set values selected in the combox of its subform?
Thanks for your help
View 1 Replies
View Related
Sep 7, 2005
Hello,
I am trying to run a macro on doubleclick in a subform (dataview) that will open the same record in a popup form (tabular).
I've enter in the macro Where Condition the following statement to only show the record I doubleclicked on in the popup. The only problem is it's asking me for a parameter value for the LogID. Its apparently not picking up the LogID I doubleclicked on. Is there any way I can fine-tune this WHere statement so that it knows the record LogID I clicked on. (The pop up form should show only the same record).
[LogID]=[Forms]![CommunicationLog Subform]![LogID]
View 1 Replies
View Related
Feb 26, 2015
In the Purchase Order details form a Supplier has to be chosen via a combo box. Based on that another combo box in the subform displays products only from this supplier (Products table is linked to supplier table).
I managed to let the subform combo show only relevant products using criteria referring to the main form combo box. Also other product data will show accordingly in text boxes. So far so good.
However when I close the form and reopen it the subform combo box is blank, other text boxes still show the right values. If I remove the filter criteria for the subform combo then all fields show all data correctly. (However the combo box is unfiltered again 8-/)
So somehow the 'criteria' prevents the combo to show the value that was previously chosen.
View 2 Replies
View Related
Nov 5, 2013
I'm trying to get a combo box & button to work together. On the main form of the attached database, I just want the button to go to the associated record based off my selection (or entry) in the combo box.
I've tried the following:
- Looked through the Northwind sample database for a close example. Tried my best to replicate the functions but it didn't work
- Looked through other examples posted and tried to manipulate the code to no avail
- Tried using [Forms]![Main Form]![cmbLastName] in both the filter & criteria section of the macro
View 4 Replies
View Related
Aug 7, 2014
the forms are not opening in modal/dialog mode when they should be.The forms' pop-up and modal properties are set to "yes"..The code specifies to open Dialog so, for example:
Code:
DoCmd.OpenForm "frmCompanies", , , , , acDialog
Yet, the form opens behind the other form (which, incidentally, is also set to be pop up and modal in the form properties--is that the problem? If so, why wasn't this an issue until now?).
View 14 Replies
View Related
Mar 8, 2013
I have a main form with multiple subforms in tab view, right now the forms only open in edit mode, I would like all forms to open to new record mode. I know I can set the main form with the switchboard manager but what about the subforms?
View 2 Replies
View Related
Aug 16, 2005
Instead of using command buttons to open forms
I would like to open forms displayed in a list box
Is there a way of doing this, so for example the
listbox will show
CustomerForm
SupplierForm
OrdersForm
ProductsForm
When any of the above is clicked the relative
form will open.
Regards
jmeek
View 9 Replies
View Related
Aug 23, 2005
I have a form with a bound combo box listing names, [myname] and a multiselect list box that lists all available forms in a database [myselections]. I am really struggling with code that will enable the user to hit a command button that will then open the selected forms to show the data for the selected individual. I have found things related to selecting items in tables etc but not related to opening forms to specific entrys and I am just not experienced enough with SQL to get this working. Can anyone help or direct me to a good example?
View 1 Replies
View Related
Feb 9, 2006
I have a drop down with a list of years (2002, 2003 etc) that the user must select from. when they do so and click the GO button a new form will be displayed. I need to use this year to compare against a field in the table that the new form is using. However the field is in a dd-mm-yyyy format that can not be changed.
Is there any way i can do a like search on the value of the drop down against the value in the table to only give the records with a particular year? what i have at the moment is below but obviously this wouldnt work because it is saying, is dd-mm-yyyy like yyyy. How can i turn this like search around so its yyyy like dd-mm-yyyy?
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Master NCRs"
stLinkCriteria = "[OpenDate] like " & Me![NCRYear]
DoCmd.OpenForm stDocName, , , stLinkCriteria
thanks
View 1 Replies
View Related
Nov 17, 2006
Hi All,
I am opening one form (Form B) from within another form (Form A), I would like to stop all the followin code in Form A from being processed until Form B is closed.
Any tips?
Cheers,
Aaron
View 1 Replies
View Related
Mar 6, 2008
is there any way you can reopen the form where you last saved/closed it
e.g if i was on record 300 and then closed the form. then when i re-open the form, record 300 is displayed and then the other records after it
any help welcome
Thanks
View 11 Replies
View Related
Jan 31, 2005
As you Can See I have attached just one form in my database.
I have created a combo box with a value list of forms which are in my main database. And then put in command button to press to open the form you have selected in the value list.
but alas i cant get the right code to be able to open the form with the selection from the value list
Any ideas oh sooo kind people?
View 3 Replies
View Related