I have a form with a subform. The form has 2 controls, Preview and Submit. The submit button moves the records users are entering (Date, Company, Hours) from a Temp table to a ServiceTbl.
The users are allowed to select "?????" in company in case they don't know it at the present time. At the end of the month when all of these records will be 'Submitted' to the ServiceTbl, I need to check the value of each Company ComboBox on the Subform for the "?????" entries.
I tried the code:
If Me.CompanyCbx.Text = "?????" Then
MsgBox("Enter correct company.")
End If
However, that only works on 1 record, and that record has to be selected on the subform. If a new row is clicked, as in the user is going to enter new data in, but chooses not to, it still doesn't work.
I have created a new database which i have split using the database splitter creating two files, the front end (.accdb) and the back end (.accdc)
The front end works find it allows me to input data and can be used my multiple users as once,however when i come to add a new table or new field within an existing table i get the following error when opening the .accdc:
currently the database in on my C drive however i have also tested it on the network and i am still having issues?
i have edited the access trust settings and trusted both the c drive and the network directory yet i am still having no luck?
One shows my form with the Transporters Subform with 3 entries, and 1 entry.The three line items that say "Transporter" are in one subform. I used this code
Code: Private Sub Form_Current() If Me.RecordsetClone.RecordCount >= 3 Then Me.AllowAdditions = False End If End Sub
to limit the number of records I can add to 3 or less.My issue is that I lost the blank text box that allows you to add another record. So, if I only have one Transporter listed, there's no box to let me add a second or third.I have the following properties for the Transporters Subform set to "Yes":
Data Entry Allow Additions Allow Deletions Allow Edits Allow Filters
I have a form which needs update ever month. When the form is opened, the end user can see the old records and data, and also a new record is added for any new data. I want to protect the old saved data and the user can only add, edit, or delete the new data in the newly added record. The problem is once a user adds the new data and moves to another record or another form, then he/she cannot edit or change the new data in case if there is any mistake or need to change something after couple of minutes.
I changed the Form Data Properties "Allow Additions", "Allow Edits", and "Allow Deletions" many different times and situations to solve this problem but with no success. I tried the following with NO success too: One of the Fields of the Record is (Month). In the Data Properties, I set a Default Value for this field as(December 2014) for instance. I set the Data Properties "Allow Additions", "Allow Edits", and "Allow Deletions" to (Yes). Then I put the following code in the Form's Current Event:
Private Sub Form_Current() If Me.month.Value = "December 2014" Then Me.AllowAdditions = True Me.AllowEdits = True Me.AllowDeletions = True
I have a bound continuous tabular form,However, based on data content in one field of a record, I want a checkbox in the same record enabled, so the user can check it if necessary. I have created a record set using the form as shown below, and I am looping through each record. To show that my code is referring to the field with required data content, I display it as a message box and it works, yet my checkbox does not enable.
I have the code in the form_load event, however, for testing purposes I have it behind a button.If I am seeing this properly, the code behind the button enables the checkbox for ALL records once the criteria in the required field is true, and based on the last record, which has no data content, it disables the checkbox in ALL records. I also have the PK ID for each record hidden in the form. Can I utilize that to target the checkbox of each individual record??
Form Detail -Form does not allow additions or deletions. Edits allowed -All fields are disabled and locked -I only want the check box to unlock if data is found in the "RequiredField" as referred to below. I have also tried if not isNull(requiredfield.value) then -enable checkbox, which yields the same results
Here is my code
Code:
Dim rstMyForm As DAO.Recordset Set rstMyForm = Forms!MyForm.Form.Recordset rstMyForm.MoveFirst Do While Not rstMyForm.EOF If Not RequiredField.Value = "" Then
I have a form that launches a query. The results are displayed in a continuous form called ParentForm. On the ParentForm is a combobox which selects a singleform called a ChildForm that displays the details of the selected record. I placed a command button on the ChildForm. This button simulates a circular triple state toggle switch. By clicking this switch the form goes from ReadOnly to Edit to Add modes. The form properties AllowEdits , Allow Additions and DataEntry are adjusted accordingly. These properties when they are changed seem to initiate requery of the underlying data source. Here is the code. I am looking for a way to avoid requery of the data when the mod is changed.
Code: Private Sub ModeBt_Click() '------------------------------------------------------------------------------- ' Circular toggle button to change display mode of the form ' ReadOnly - Edit - Add '------------------------------------------------------------------------------- Select Case Me.Mode Case "Edit Mode" Me.AllowEdits = False
I am following mice and am trying to build a form that lets me add a new mouse to the database. I want to be able to either enter the the unique mouse id of the mother if I know it or be taken to another form that lets me identify the mother from the females already in my system. I know this is possible because I have seen examples of it where, in the find mother form, I give the strain name in a combo box which narrows down the selection of mice in the DOB combo box which in turn narrows down the unique mouse id which is the information I really want. I then want to carry that id back to the original form to enter it as the mother id.
In an ideal world the database would recognize this id being put in for a mother and note in the mothers record that she has had a litter. The litter id, which I am currently composing of motherid&fatherid&DOB, would go into the mothers record.
I'm developing a system which uses linked tables (to an Oracle database) and subforms. I'm trying to add functionality to create new child records, but am running into errors when saving these records.
Parent table is PATIENT, child is DIAG. I have my DIAG Form_Current event set up to detect whether a record is new. When this happens I populate the DIAG foreign key with the relevant PATIENT primary key, and run a query to the underlying database to find out the next DIAG primary key. I then populate all the necessary fields.
On attempting to leave this record however, I get an ODBC call failed error, telling me that the the primary key constraint in the database has been violated. The reason is that Access isn't saving the record to the underlying database. I've tried to prompt this using Me.Dirty and RunCommand acCmdSaveRecord, but both of these just generate type mismatch errors.
What am I missing? Is there some particular set up for linked tables and creating new sub-records that I need to put in place?
I have had some issues caused by users exiting the database entirely when they realise that they have entered something incorrectly; this in turn has caused problems re-opening the half finished record (the last step of the record creation is to allocate it a unique reference number, which is then used to re-open the record for editing on a point and click form) - now, this is entirely my fault for expecting users to clear up behind them or to exit properly.
So, I am making some changes - when the dashboard form opens it removes the database window close button. I have a separate close button which has the following code:
Code: Private Sub cmdGoodbye_Click() Do While Forms.Count > 0 DoCmd.CLOSE acForm, Forms(0).Name, acSaveNo Loop DoCmd.Quit End Sub
However, I would like to add a line to automatically save any records before closing each form - is this possible?
Hi, I have one table but two forms to enter info into this table, when I enter data on the first form this goes on line 1 (record1) and when I then go to the next form and enter data, this goes on the next record?? How can I ensure that all records are on the same line... (I can't setup separate tables at this time)
I have two forms. Form 1 has a listbox. I select (for example) in the listbox the employee i want to edit. Then i press edit and in the new form the proper employee opens. But when i want to scroll more records, then there arent. I have to go back to the listbox and reselect the next employee.
What i want is that i can also scroll in the second form.
Im using this query: ((([Meeting]![MeetingCode]) Like [Forms]![MeetingView]![MeetingView]))
I have a large problem which I can't figure out (well 2 actually but the other is less important):
1) I have a form which brings up the results of a search performed by the user (only contains some fields). From this list of results i would like the user to be able to a) see a full report of that Record (which I've done ok) and b) edit the data contained in that Record.
My results form opens the editing form no problems, however, i cannot edit any of the data contained within it. This only occurs when the results form is open as well so i guess it's because there are two instances of those fields open simultaneously. However, I am reluctant to close the results form because the results will be lost.
2) I've tried several methods to open the form at the desired record: - using the WHERE condition argument of the OpenForm function - creating a filter in the editing form that runs in the OnOpen event These two require the creation of a variable (I'm using the Key field) that is inserted into these bits of code. However, all of my attempts thus far have been unsuccessful; every time it asks for the Parameter in a popup. I've defined the variable as a Public variable in a seperate module but don't really understand this aspect partcularly well; I'm obviously missing something. - the form currently opens from it's own query that gets the Key Field Criteria form a hidden control on the results form.
Here is my code for the 'Edit' button:
Public stProjectID As String
'Results form 'Edit' button click: Private Sub btnEdit_Click() stProjectID = txtID2 [Forms]![frmResults].Visible = False DoCmd.OpenForm "frmProjectEdit", acNormal End Sub
'Edit' form open: Private Sub Form_Open(Cancel As Integer) Me.Filter = "ProjectID = stProjectID" FilterOn = True End Sub
I have two forms, reservation forms and contract form. The firts 10 fields are the same in both forms. I want to copy the information that i have in the reservation form to contract form, and not typing again. How can i do it, using macro or vba code. In this case what code?:confused:
You know on forms, you have those little Left and Right arrows (< >) at the bottom of the form, and you can click on them to switch between records... yeah?
Well, how can I make the form switch between records with VB. Lets say I want a VB script that jumps to the 5th record in the table, how would I do that? Normally you would just click the Left arrow 5 times... but I want to do it with code.
Hopefully I have provided enough info as I have tried to keep it concise...
I am adding records to both a parent table and a child table using a form (for the parent db) and a subform (for the child db). When enterring data into the subform, I would like all previous records enterred into the subform (for a given entry in the main form) to remain visible as new records are entered (rather than simply having the view switch from one record to the next). A follow-up question would be...how do I get a unique identifier variable to increment one unit every time I add a new record into the subform, e.g.
i have two forms: Reservations form and Contract Form, the 10 first fields are the same in both forms, the rest fields are diferents. I want to copy, duplicate or transfer the same records in the forms and not type the same information again in the contract form, you can help me please?
Firstly, I create a form and sub-form relationship of which the sub-form linked with a combobox on main form. When user wondering in the combobox, the subform could display relavant records related to the invoice number selected in the combobox.
In the subform, records got a YES/NO field (named CHECKAMT) and when I used the following coding to update records in the subform, a message something liked saying the record had been used by another user, you may overwrite those records, copy those records to another place or undo and quit!!
Set TRANS2 = db.OpenRecordset("select * " & " from MSQUARE WHERE INVNO = '" & Me.INVONUM & "'", dbOpenDynaset) TRANS2.MoveFirst Do While Not TRANS2.EOF TRANS2.Edit TRANS2![AMOUNT] = Null TRANS2![checkAMT] = -1 TRANS2.UPDATE TRANS2.MoveFirst LOOP
My client wants to be able to have a form open with a record, then open the same form with a different record. In all my experience I have not had this request or seen it done. I assume I could have a different form to open the second record. How to confirm my assumption?
The situation is they have a sales lead open and they get a call and need to open another sales lead without closing the other one.
I have a database I created. its has Units, then it has Tracts and under tracts it has Leases. the main form is for the units. then I have a sub form which is tracts. in the tracts there is a field for Leases Vol/Page. everything works great. now I have a client that wants to send me Title opinions which are for several of the leases in the tract sub form. I need to input the info in a form and have it saved in fields in each Lease at one time.
Right now I have to goto each lease and insert it every time one by one. the field for each lease is the Vol/Page field. is their a way I can do this without having to goto each lease one at a time.??????? in other words one title opinion might be the same for ten of the leases I need to update these all at once.
I am building a Form based on 3 Tables. Each with primary keys, although two tables do not relate to one another, and I am using one table to be the link within both of them, which has both of the primary key fields within it.
The issue is that I am building this form and in the control source I am building this query to pull the information for the form, which I was hoping will allow me to add new records (Not Working ). I am also attempting to accomplish that when I integrate a field from one of these tables into the form (the table that does not relate to it at all, other than through the linked table) that it will show the fields relating primary key in a transparent text box. This field I am integrating will be disabled for editing (like transparent), but will show up when the corresponding field (primary key) populates with the appropriate number.
The Fields in the pictures on the form that are dimmed are the fields that will not be enabled, but once I do this it does not allow me to enter New Records .Here is the SQL:
SELECT TblSupplierTests.*, TblCreamReceiptsScaleWeights.LoadID, TblLOLCreamTests.BFTestForSettle, TblLOLCreamTests.SNFTestForSettle, TblCreamReceiptsScaleWeights.RecievedDate, TblCreamReceiptsScaleWeights.SupplierLBS AS SupplierLBS_TblCreamReceiptsScaleWeights FROM TblLOLCreamTests RIGHT JOIN (TblSupplierTests LEFT JOIN TblCreamReceiptsScaleWeights ON TblSupplierTests.BOLID = TblCreamReceiptsScaleWeights.BillOfLadingID) ON TblLOLCreamTests.SO = TblCreamReceiptsScaleWeights.LoadID;
The Parent table Material_Assignment uses a form (frmAssign_Materials) with two Combo Boxes (cboMaterials_ID and cboEmployees_ID) to select and create records of....of course assigned materials.
I need or want to duplicate a selected record from the Material_Assigment table (Which includes the Materials_ID(PK) pertinent information and the Employee_ID(PK) pertinent information and edit it to insert the Return_Date and Quantity_Returned information. Since, obviously I can't edit and should not edit the existing record. I Have tried by creating a second form "frmreturn_materials with a Combo Box which shows all the materials assigned. It looks great but when I select a record, I cannot retrieve the data because the record is bound by it's auto number field Asset_ID. I mean, how else can I setup a query to record materials out and materials in?
Is it possible to add a row between rows on a form. I am creating a contact list containing phone numbers and groups. I dont want to sort the form out in ascending order, just by group order.
For example: Joe Teacher (primary school) 12345 John Teacher (primary school) 67777 Ann Teacher (secondary school) 35555 Mary Teacher (secondary school) 388338 Sarah Nurse 373773 Tina Nurse 111111 Peter Footballer 199999 Rob Footballer 888888
I posted earlier today and despite all of my best efforst I have made very little progress. I keep hitting my head on the desk at the same point.
I am trying to get one tool entry to link to many records for each tool.
The form [frmVibrationResults] holds tool info, PK is [serial number/reference] as a text field.
The subform on this form called [frmVibrationMagnitude] holds test data for each tool. I want to be able to add a record for each tool for each test. At the moment it only lets me add one per tool. If I try and add more than one record for a tool I get an error message telling that I am duplicating information in the PK, index or relationship.
I have tried all day to solve this and can't proceeed without it working. Can anyone help. I've attached the zipped version of the DB.
I'm sure this has a simple solution, but iv searched this forum and every solution that i get is filled with code that goes over my head! Well here goes...
I have a main form called expense... which contains a tab control. the tabcontrol in turn has three pages containing a subform each. (lets call them sbfrm1 sbfrm2 and sbrm3.) All three subforms are based on three different queries (say Qry1 Qry2 and Qry3) but the three queries are based on the same table. this table contains all the expenses incurred over the months across three categories (hence three queries). the subforms are to display these expenses according to categories.. i.e. sbfrm1 displays records pertaining to Category1, sbfrm2 for category2 etc.(the queries ensure that!)
when the main form opens, the subforms display all the records in the table according to category...but not according to the month in which the expenditure was incurred.
I now want to add a feature that enables the user to choose records pertaining to a given month at the click of a button.
for eg. if there is an option group named month, (with toggle buttons as the month names), then if the user selects the month Aug, then immediately the subform1 displays records under category1 for the month Aug? However I want to include an "ALL" option as well whereby all the records are displayed for all months (the category criteria must be maintained at any cost!!!! Is there a solution that will not use too much code!