Modules & VBA :: Open Drop Down Box On Subform
May 3, 2014
I want to open the dropdown box on my datasheet view subform from the main datasheet view form when I run over it with the mouse.From my main form textbox [WelderID]I tried this code but doesn't work. I get the error invalid reference to the property Form/Report.
Private Sub WelderID_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)
Forms![Main]![WorkOrder Form]![DrawingNo fm]![Welds fm]![WelderStamp Sfm]![WelderStamp].SetFocus
Forms![Main]![WorkOrder Form]![DrawingNo fm]![Welds fm]![WelderStamp Sfm]![WelderStamp].Dropdown
End Sub
I am not sure if there is more code to use to open the subform in the datasheet view.
View Replies
ADVERTISEMENT
Mar 7, 2014
I have a form (frmSearch), based on (I think) John Big Bootys code. On it, a search box, which filters results as you type. Works great.
Instead of presenting the search results in a listbox, I wanted it in a subform (sfmSearchresults). Also works great.
Problem was this: I wanted a button on this form, to open another form based on [CustID]. For a listbox, I could use columns(0), but not for a subform. After much trying I got this to work:
Code:
Private Sub cmdVisaPren_Click()
Dim strWhere As String
strWhere = "[CustID] = " & Me.sfmSearchResults.Form.Controls.Item(5)
DoCmd.OpenForm "frmAddCust", acNormal, , strWhere, acFormEdit, acWindowNormal
End Sub
The part that I don't understand is the Item(5). The subform is based on a query (qrySearch), from tblCustomers. tblCustomers fields is as follows:
CustID, FirstName,LastName,Adress1,Newspaper1,Newspaper2.
Item(0) in strWhere would return Adress1 as [CustID].
Item (1) = Newspaper1, Item(2) = Newspaper2, Item(3) = FirstName, Item(4)=LastName, and (finally) Item(5)=CustID.
I don't get the logic. With listboxes, I could just count columns for columns().
Have attached my database. It's just a test database, with 4 people. The final database will have about 1200 people, and many more fields. Its .accdb (Access 2013). I tried converting to Access 2002-2003, but couldn't get it to work.
View 4 Replies
View Related
Apr 19, 2015
How do I reference a subform DS field to open up a tabbed form on another subform.
Here's what I have.
field one on the Sub DS opens up tab one on another form, as does field two on DS open tab two on another form.
but..
how can I click on "any" field on the DS, run an IF statement, and it checks if that record on the Datasheet, contains information in regards to, IF field one OR field two contains any data, and opens the tabbed form respectively on the other form?
View 3 Replies
View Related
Apr 3, 2014
I have a form with two subforms. One subform is a datasheet that pulls data from a temp table. During the other subforms Form_Current, the temp table is emptied (DoCmd.RunSQL "Delete from tblAddRefs"), reloaded with data relevent to the current record, and requeried (Forms("frmEDFP").Controls("tblAddRefs subform").Requery). This works like I want it to...
With the exception of the initial load of the main form. The subform based on a table shows (#Deleted) instead of data. if I step through the code, I can see that the temp table is emptied and repopulated by the time I try to requery the subform. This is still happening during the Form_Current of the other subform, which is successfully running on main form load.
If I requery (Forms("frmEDFP").Controls("tblAddRefs subform").Requery) using a button on the main form once it is loaded, the #deleted data is correctly is replaced by regular data, so it's like the requery in the Form_Current event isn't doing anything during load.
View 2 Replies
View Related
Nov 15, 2006
I have an MS Access problem I need some help with. I am trying open a form for input from selection in a drop down menu in an access database. Any ideas on how I should do this??:confused:
View 3 Replies
View Related
Aug 4, 2006
Drag and Drop works great but how do I open a reports based on what I selected?
I have two list boxes the first is "items not selected" and the second is "Items selected" now I want to create a button that open a report showing the result from "Items selected"?? Hope someone can help I've been to ms access web site but our firewall does not allow any down loads. Thanks in advance.
View 3 Replies
View Related
Jul 29, 2014
The main form has fields for Record ID, Position, and Revision. The subform has fields for ID, Position, and Revision. There is also a field for "task". I have over 15 positions and 495 tasks. Each position has a set number (around 15 or so) tasks associated with that position.
I have the Position in the main form and the subform linked so when I select a position on the main form, the subform loads the same position. The question field (drop down) is "fed" from a query which contains all positions and all tasks. What I want the subform to do is when I select a position the drop down ONLY displays the tasks associated with that position.
I tried using an event procedure "On Click" and "After Update" to no avail. The embedded macro was:
Apply Filter Where condition= [tbl_Detail Cost Information]![Position]=[qry_attempt 1]![Position].
I also tried the reverse Where condition =[qry_attempt 1]![Position]=[tbl_Detail Cost Information]![Position]
The result is a fully loaded (all tasks) drop down.
View 4 Replies
View Related
Apr 5, 2014
I've been trying to create a subform within a form with the subform having a drop down list. Once I have that figured out I will be adding another level (another subform with drop down list within the subform already mentioned).
I am able to create the subform with the form but I'm having trouble with the drop down list. I will explain what I am after with an example.
Form - contains models of vehicles (Jetta, GTI, Golf, Passat, Touareg, Tiguan, etc...)
Subform 1 - contains tranmission type (automatic, manual, tiptronic, paddle)
Subform 2 - contains vehicle color (red, white, black, blue, green)
I would like to use the form described as a way to input all the vehicle variations as they are needed. Then it would be desirable to use that information on an another form.
Another form, an Order form would then use the vehicle variations. The user would select the model of vehicle and in the drop down for transmission type would only see the available selections based based on the variations built above. Likewise, once transmission type is selected, the colors available would be shown in a drop down list, but only the colours available for that particular vehicle and transmission combination.
The above is a simplified example. The real application for this method will be a product line that will contain over 150 styles, with variations in appearance and colour.
View 14 Replies
View Related
Jun 1, 2006
Problem:
Visual Basic run-time error 7792: You can't open a subform when it is also open in Design view.
I have a subform with properties for SourceObject, LinkMasterFields, LinkChildFields changing according to objects and events in the master form.
The subform was bound to a query before which meant that the subform load event was happening as soon as the master form is loaded. I needed to restrict the subform loading until a certain point so I removed the SourceObject property for the masterform's subform. The subform on the master form is now Unbound.
(This is because I'm now running some code on the FormLoad event for the subform which needs to be restricted until the LinkMasterFields and LinkChild Fields properties have been assigned correctly otherwise it takes ages to load.)
Now I'm getting the above error. Obviously, i do not have the subform open anywhere in design view. No Visual Basic windows are open. I've closed the db, closed access, reopened it and clicked on nothing except the masterform. The error occurs when I raise the event in the master form which assigns the sourceobject property to the subform, i.e.
Me.sfmQryAllOV.SourceObject = "sfmQryAllOV"
Can anyone help me? I've googled this but finding no answers.
View 1 Replies
View Related
Dec 2, 2004
I have a form and a sub form. How can I create a dropdown/lookup field on the main form, which will find the customer details from the customer table, and then access the correct subform for their spend details?
I hope someone can help. Thanks in advance.
Regards
Peter
View 7 Replies
View Related
Dec 15, 2013
I have:
Tables: Customer and Orders
Relationship: Customer ID is the primary key in Customer and is a foreign key in order table.
I need to create a Form with contains all the customer info from the customer table, as a drop down list. Once the customer is selected, all their orders should appear in a subform. At the minute I can get a form to work which shows all the orders but you have to go to the next record so see the order. For example it will say John smith and one order. The next record will be John smith again and their second order in the sub from.
I have used access in the past and I am fine with creating everything apart from the drop down. I am just a bit lost with the structure.
View 2 Replies
View Related
Mar 19, 2014
I am self thought and fairly new to access (quite fun )
It is a simple setup: I have a main form called "customer_information_display_form" within that form is a sub-form called "customer_information_form" in addition there is one combo box drop down menu
I would like to filter the information presented in the sub-form by company name located in the drop down menu.
View 3 Replies
View Related
Mar 12, 2013
I have built a form that holds details of training records. What I want is when a drop down is selected in the main form, that it will populate some of the fields in the subform. I have this working at the moment, that for example, when a certain course is selected, that their modules will appear in the subform. Where my problem arises is that I have a relationship between two tables that I want to appear on the subform, so that details can be filled in on the subform against the list of modules that automatically appear.
View 2 Replies
View Related
Feb 5, 2005
I have a main form which has a subform control in it. when the main form is opened the sub form control contains a list of events in a sub form (a summary view), for the person selected in the main form.
I want to change the subform to a different one which shows the whole event when i click in a field on the subform, based on the event i clicked in. ( i can do it by opening a new form but not with a new subform)
I can make the form change using the following code:
Private Sub Notes_DblClick(Cancel As Integer)
Me.Parent.subformhere.SourceObject = "eventsfullrecord"
End Sub
What code do i need to make it open to the record i clicked in the summary form, rather than just opening to the first record every time?
Not very good at passing recordsets
Thank you
View 4 Replies
View Related
Aug 21, 2013
As I am moving through my code, I'd like there to be a pop-up box which asks the user to choose from a list of dates. This list of dates only resides in a filtered recordset in the background.
Once the date is chosen, then my code continues onward..I know I could make some sort of pop-up form, but I'd rather not have to go in a design all that just for a list of dates...
1) Is there such a thing as a dropdown list on a Input box?
and even if there isn't...
2) Is there a way I can bind the column in a recordset to a dropdown list?
View 2 Replies
View Related
Jul 7, 2015
I had 3 drop down filters that worked when the word being filtered was written in the table. I have since then linked them to new tables to be more database-y. The problem I have found (a couple weeks later too) is that my drop downs broke.
It makes sense why, they are now 1,2,3,4 instead of words but how do I make this work now that it isn't in the current table?
Code:
Private Sub cboMDS_AfterUpdate()
Dim myPlane As String
If Me.cboMDS = 0 Then
myPlane = "Select * from Baseline"
[Code] ....
View 10 Replies
View Related
Oct 1, 2013
1) I want to figure out how I can drop a table using "if argument". If the table exists then drop table, if not exists do something else.
2) I want to figure out (ALSO) how I can drop a column using "if argument". If the column exists then drop column, if not exists do something else.
I wrote something but is not enough..I can't find more clear information about that.
Function first()
On Error GoTo Macro1_Err
Dim BD1 As Recordset
DoCmd.SetWarnings False
Set BD1 = CurrentDb.OpenRecordset("BD_example table")
[Code] ....
View 8 Replies
View Related
Jan 5, 2015
I have a form with First name, Last name, Employee number, Information. The information box is a drop down menu with four options (contact, emergency, company, personal) I would like to be able to enter in search criteria for an employee using one of last name first name or employee number then choose an option from drop down box click a button to search and have it pull up just the info I needed.
I think I have two options but i am not sure which would be more efficient.
1. creating a query and using the criteria from design mode to have it filter the information. The only problem with this one is I do not know how to set it up with the drop down box from the form. Or would I need multiple querys for each option or just one with all of it?
2. writing code for the search button on the form that will bring up the appropriate query (I think I would then have to create a query for each drop down option)...
View 1 Replies
View Related
Nov 10, 2014
I am in the process of trying to create a DragNDrop feature in the Access database that I've built. I have 3 employee with several different txt boxes all side by side and I need to be able to drag and drop the job from one to another.
I need to create a class module to do this but my problem is I don't know how.
View 7 Replies
View Related
Jul 24, 2012
Is there anyway that access could create a drop down box within a drop down box? For instance, when a selection is made in a drop down box, it opens another drop down box with choices.And is it possible to link an inserted image from a form to open in MSPaint that when it opens, the image is already there?
View 1 Replies
View Related
Apr 17, 2015
I have a lot of reports I have created. A lot of them are the same report but with different criteria. Right now I just have a report form, which displays all of the reports with buttons and the user chooses the desired report, clicks, and bam. In an attempt to make this look nicer and cleaner, is there a way to use a couple of drop down menus to open the reports. For example, can I group them by the main report category, have a drop down, click on a desired report and it opens from there??
View 12 Replies
View Related
Mar 18, 2006
Hi,
I have a main form with 2 subforms.
I am trying to create records in the second subform based on records in the first subform nd the current record in the main form.
at present i can create the new record and paste information, however i cannot seem to advance records in teh first subform to repeat the procedure.
and code or macro i try returns a 'object not open' error
any help would be great.
View 13 Replies
View Related
Sep 4, 2014
I have a form called frm002_PAF_MonitoringMAIN and on this form I have a subform called frm002_PAF_Monitoring. The subform has a button to another form for contact details called Contact_Details. The Contact_Details form opens with the details of the person who I have selected on frm002_PAF_Monitoring. There are some fields on frm002_PAF_Monitoring that I would like to be populated on Contact_Details when opened, like FirstName and LastName. How can I do it?I have tried on afterupdate event on Contact_Details below but those don't work:
Me!FirstName=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me!FirstName=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]
View 11 Replies
View Related
Feb 2, 2005
Hi All
I have a subform called frmProducts and on it I have 2 command buttons One is to use the current open form to jump to a particular product to make it easier to edit the details and the other is to use the current form and jump to a new record.
Now I have this working when running the form on its own but when I try and run it as a subform it does not work. I am not sure how to adjust the coding to let this happen.
the Main forms name is "MainForm"
Below is my current coding to open the form at a particular record
Private Sub EditProduct_Click()
Dim Msg As String
Dim Title As String
Dim Defvalue As String
Dim Answer As String
Msg = "Enter a Product Name: "
Title = "Open Prouct Form"
Defvalue = ""
Answer = InputBox(Msg, Title, Defvalue)
If Answer <> "" Then
DoCmd.OpenForm "frmProducts", , , "[ProductName]='" & Answer & "' "
Else
DoCmd.OpenForm "frmProducts"
End If
End Sub
Below is my coding to open the form at a new record
Private Sub NewProduct_Click()
DoCmd.GoToRecord , , acNewRec
End Sub
Many thanks in advance for all assistance
Sirch76
View 2 Replies
View Related
Jul 25, 2006
Hello all,
I know I have seen this before and I have searched the forums several times and cannot find it now.
Maybe I am searching the wrong thing. Can someone point me in the right direction?
I need a button on my form that opens a subform or subforms when clicked.
How do I set this up?
Thanks,
Di
View 4 Replies
View Related
Aug 14, 2006
Hi all,
I have a form with a button on it, that when clicked it will open a subform on the same form. But, when I clicked this button, it gave me this error message:
The expression On Click you entered as the event property setting produced the following error: A problem occurred while [Database Name] was communicating with the OLE server or ActiveX Control
For more details on this error message, see the attached file.
Any attempt to help will be highly appreciated.
Sorry for bothering you.
View 2 Replies
View Related