Form #1 allows me to modify/add data to records in Table A.
Form #2 is restricted to displaying (no edit, add, delete capabilities) information from a query that is based on Table A.
I need to find a way to open an instance of Form #2 while in Form #1, but I keep getting the following message...
"The table 'TableA' is already opened exclusively by another user, or it is already open through the user interface and cannot be manipulated programmatically."
Any suggestions for how I can get around this?
The data I want to display in Form #2 is not linked to the record being displayed in Form #1, so a subform will not work.
I wish to open a form based on the transaction table populate one of the foreign key fields with a selected value from a combo box from the switch board (with going to a mainform&subform). I know how to get the value of the combo box on the switchboard. I just know how to then store this value in the foreign key field. stSelectedCustomer = Forms![Switchboard].[CustomerID] gives me the value from the combo box on the switchboard. I then want to open the transaction form to open a new record and have Customer ID on this form be the stSelectedCustomer storing this value in the transaction table when the user enters values in the other fields.
I have a problem with opening forms.I have situation with 8 forms (small ones!) which must be open based on values in ComboBox1 and ComboBox2. Can I do it with Select case (DoubleClick event), and how?
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
I have a form with a regular save record command button, however I also want to add in an action to open a second form based on information stored within the form.
So users may be directed to Form.alpha or Form.beta depending on their data.
I have some code in my database that will open a form based on the result of , I think, a union query.
Private Sub resultbox_DblClick(Cancel As Integer)
'Open report based on the ID from resultbox listbox
DoCmd.OpenReport "ResultsStan", acViewReport, , "[ID] = " & Me.resultbox, , acDialog 'End If End sub
What I need to do is open one of a number of reports. The report that needs to be opened depends on another value that is passed from the union query - DOCCAT
Being still a bit of a novice I tried...
'If "[DOCCAT]= " & Me.resultbox Like "Standards" Then DoCmd.OpenReport "ResultsStan", acViewReport, , "[ID] = " & Me.resultbox, , acDialog 'End If
The user select the class from [Combo28] for the unit already in [Textbox named Unit] from Form 1 and wants to list all the students for that particular class and unit in form 2.
I have tried god knows how many different codes. I've been playing with:
I have a form "frm_PatientNew" based on table "tbl_patients", this form contains a button "cmd_NewVisit" which is supposed to do the following: opens the form "frm_NewVisit" for recording a new visit for the last recorded patient in "tbl_Patients", I found many approaches depending on DMax and Dlookup and they worked fine just if "frm_NewVisit" is bound to "tbl_Patients", but "frm_NewVisit" is bound to "tbl_Main" which acts as a container for all information (patient data, visit data,service done and service provider), so the form "frm_NewVisit" contains fields from different tables. I wonder if I should create "frm_NewVisit" as unbound form, then adding fields from different tables to it and using vba to populate "tbl_Main",
I have a form based on a table called tblListMaster and I want to allow users to open up another form showing all the members of one of the entries in that table so I have added a button called 'Show List Members'.
The list members form which I then want to bring up is also based on tblListMembers (it's a master-detail form). When I hit the button to open up the list members form I get an error message saying that the table is already opened exclusively.
I can understand why I get that message so I thought I would be cunning and create a dummy form which I open up, passing in my list id in the openargs (at that point I also close the original form) and then from that dummy form automatically open up the master detail form and close the dummy.
Code in List Master form
Private Sub cmdListMembers_Click() ' open up the list members form
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.
I have a form that contains a subform. The subform is a datasheet which calls the results of a query of 4 tables (tbl_companies, tbl_deals, tbl_products, tbl_vl).
In the main form there is a button which opens a report with a historical record of dates of value changes of each product up to a chosen date. This chosen date is determined by inputting a date into a text box.
This report also sources (tbl_companies, tbl_deals, tbl_products, tbl_vl).
When I try to open the report, I get the run-time error "3211".
'The database engine could not lock the table "Tbl_companies" because its already in use by another person or process.'
I'm guessing that because the query for the subform is already calling the table, the query for the report can't call the table at the same time?
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?
All my records are displayed on a form. Upon clicking on their respective 'View' button, I would like to open that particular record. How can I do that? I have attached a screenshot for better clarity. Thanks in advance for the help!
Simple example is I have say 3 recordsets open (they are opened once as they are refered to many times) - they are open early in the form (in this example 3 price lists that are applicable for a customer) (if the syntax of the select is slightly wrong I'm just showing to 'prove' the concept).
Dim db As Database Dim rs1 As Recordset Dim rs2 As Recordset Dim rs3 As Recordset Set db = CurrentDb() Set rs1 = db.OpenRecordset("SELECT * FROM Prices WHERE (((Prices.ID)=1));") Set rs2 = db.OpenRecordset("SELECT * FROM Prices WHERE (((Prices.ID)=2));") Set rs3 = db.OpenRecordset("SELECT * FROM Prices WHERE (((Prices.ID)=3));")
What I want to do is have a central function that I can pass a list I wish to process/do something with aka. The 3 recordsets are the same except for the where criteria.
private sub GETPRICEFROMLIST(pricelist as long)
dim rs as recordset
set rs = Recordset("rs" & pricelist) .....
I put the above to show what I'm trying to do but of course that doesn't work There won't be any updates to these recordsets only reading of data.
I seem to need some help! I have a table with customer information in it ie: name, vehicle, (Key=Id number)... it is the master link to the repair table ie: mileage, (Key=ROnumber), and repair data.. these two work together beautifull now I need to add another table, a check sheet for checking over a vehicle. I create the table and the form however I cannot open a new form with the ROnumber from the second already open form into the newly open form. (the second form is based on a Query, and I have tried changing it to a SQL statement both with no luck) is there an example of what I need to be doing to link the ROnumber to the ROnumber in the new form, or create the ROnumber so it will add the data in the linked table? I need this to open using a button on the open repair form David
When creating an incoming inspection database, I want to set it up so when I am in a form to add data, I want to have a command button where I can pull up the associated CAD drawing based on part number and drawing number. I would like to enter the directory location into a table so I could change it if I need to.
I am trying to run a report based on a combobox selection. I have three different reports, each for the three different items in the combo box. I just don't know how to code it so when I run the report, it picks up the name in the combo box and opens the correct report. This is what my code looks like for the button that will run the report:
Private Sub Command7_Click() DoCmd.OpenReport ("Signers Authorized for Check Writing"), acViewPreview, , WhereCondition = [BTrans] = "Check Writing" DoCmd.OpenReport ("Signers Authorized for Stop Payment"), acViewPreview, , WhereCondition = [BTrans] = "Stop Payments" DoCmd.OpenReport ("Signers Authorized for Wires"), acViewPreview, , WhereCondition = [BTrans] = "Wires" End Sub
The problem is, that as soon as I hit the Run Report button, all three reports open up, so it is not reading what is in the combo box. The quotes, "Check Writing" , "Stop Payments" and "Wires" are the actual selections in the combobox and [BTrans] is the name of the combobox.
I am currently developing a calendar and am trying to open a recordset based off of a SQL string. When I deleted the Where part of the SQL statement, the code ran fine. So I am pretty sure that the problem lies within the Where part of the code. I use this code to filter my query based on txtTaskTypeID but if the value is null then the query is suppose to return all values. I keep getting Run-time error"3061: Too few parameters. Expected 1".
I have a main Form "Client" that shows details such as Representatives, phone numbers, status, etc. I also have a main report "CRM" that is a nicer summarized table version of all of my Client form entries.
The "CRM" form will be used by others in my office to see what clients we are contacting, etc. What I want to be able to do is have someone open the CRM form first. If they want to see even more specific info (not everything is included in the report, as that would be too messy), I want them to be able to double click the Client's name on the report and be taking to the corresponding entry on the Client form that shows more details.
Right now my code for the Report which is not working is the following:
Private Sub Client_Name_DblClick()'double click on a client name in the reportDoCmd.OpenForm "Client", acNormal, , "[Client_Name]='" & [Client_Name]'this should open the Client Form to the record of the same client that was double clicked on the reportEnd Sub
I have a table with the fields Thermometer_ID (primary key) and CalibrationType (combo box list with the options of InHouse or SendOut)
I want the user to click on a button and have an input box to input the thermometer_id. Then if the CalibrationType is InHouse open form Verification and if it's SendOut open form Thermometers.
my problem seems to be very familiar to the one in this thread :
[URL]...
Basically I have a list of tables in one combo box. I want the user to select which table. ( The tables are stock information, each table for each different day of the stockmarket)
Then they select the Stock they want to look at. ( These are the same in all the tables obviously, so it is the same in the drop down box)
NOW, the bit i'm struggling with. Is for a textbox below to show the value found IN the table name selected, with the stock selected. How would i do this in SQL, or VBA with SQL.