My inattention! You are absolutely right. The problem is now solved with your advice.
Thank you very much.
Best regards.
User Profile
Collapse
-
Hello Rabbit,
Thank you for your answer.
Even inside the loop, the same error occurs.
I will try to implement the update query.
Ty
RegardsLeave a comment:
-
Updating table with recordSource - Error 3020
Dear Community,
I am trying to update all entries from table "tbValve" when a specific criteria is verified (regarding Fabric value).
When implementing the code bellow, an error 3020 occurs (Update or CancelUpdate without AddNew or Edit).
Need help because I cannot understand why is this happening.
Thank you!!
...Code:Dim rs As DAO.Recordset, query1 As String query1 = "Select -
Hello NeoPa,
Thank you for your detailed explanation.
Always learning!
@MikeTheBike,
I was unable to put the combobox working with your solution.
Maybe NeoPa will explain later the reason for not working.
Regards.Leave a comment:
-
Hello NeoPa,
Thank you very much for your fast and accurate answer!
Worked very well.
In reality, cannot understand why using the replace function the problem is solved.Leave a comment:
-
Use a string to indicate a field in a SQL statment
Dear Bytes community,
Framework: I have an SQL statment in a public function at a module. This fuction will be used in different forms to populate Comboboxes. My question is:
- Is it possible to use a string instead of a field in the criteria of the SQL statment? The goal was to change only the argument of my Public Function in order to populate my combobox, depending on the form.
Problem: Using the code on the... -
A well deserved reputation from your knowledge and contribution to the forum :)Leave a comment:
-
PhilOfWalton,
Thank you for your reply. I will, from now on, use your recommendation. Is indeed less confusing.
NeoPa,
Thank you for your reply. You are absolutely right. My VBA code was working because I had the queries in the database. When I deleted them, the code stopped working (because qry1 was just a string as stated by you).
When I used your code, it started working. Amazing!!! Wasn't able to do...Leave a comment:
-
Hello NeoPa,
Thank you very much for all the information given.
In reality, I have a table with the following fields: Id, ValveName, InterventionNum ber, Factory, Completed.
In the combobox I want to put ValveName, Factory and InterventionNum ber.
First the results are filtered by maximum InterventionNum ber for each unique combination of ValveName and Factory. After this step, a filter is applied again (completed...Leave a comment:
-
Hello PhilOfWalton,
Thank you for your reply.
I have understood the ideia but not the code, in particular the last part where it is used Chr$(34).
Best regardsLeave a comment:
-
RowSource for Combobox using max function
Dear bytes community,
FrameWork:
I have a table with the following fields: Id, Name, InterventionNum ber, CheckPoint, Completed
In a form, I have a combobox that I want to populate with the entries that are obtained using the following criteria:
-First: check the maximum InterventionNum ber for each unique Name;
-Second: filter the results of the first operation using the Completed field (it is a checkbox)... -
RowSource for Combobox using max function
Dear bytes community,
FrameWork:
I have a table with the following fields: Id, Name, InterventionNum ber, CheckPoint, Completed
In a form, I have a combobox that I want to populate with the entries that are obtained using the following criteria:
-First: check the maximum InterventionNum ber for each unique Name;
-Second: filter the results of the first operation using the Completed field (it is a checkbox) equals... -
PhilOfWalton,
Thank you for your reply.
Well, having the ValveTag without unique values it not a problem since in the combobox selection there is two columns (ValveTag + Localization) and when the user chooses the value there is only 1ID selected.
The problem of the blank line happens because when the form is updated, there is an avaiable ValveID in order to store the blank values. Private Sub Form_BeforeUpda te cannot...Leave a comment:
-
PhilOfWalton,
Thank you for your answer.
I have changed the field name to ValveTag.
This field is a required field but not Unique since, for example, one refinary can have two symetrical stations where the names of the valves (Tag) will be exactly the same.
The piece of code I introduced at the save button routine is to ensure that the TAG is introduced:
...Code:If IsNull(Me![Tag]) Then MsgBox "TagLeave a comment:
-
Form used to send/edit data from table is creating blank lines
Dear Bytes community,
Framework: I have a form where it is possible to add new information (via the New valve button) or to Edit the data that already exists at the table (via the Edit data button).
All fields are bound to the table with exception to the "Choose Tag:"
When new valves are introduced, or edited, it is necessary to click on the save button in order to save the information.
Problem: Along... -
PhilOfWalton,
I have one more question. Should I create a new topic?Leave a comment:
-
PhilOfWalton,
Thank you very much. The code is working perfectly!!
You have been excelent. Now I just have to solve some incompatibiliti es with my code.
Amazing!! Just what I wanted!Leave a comment:
-
PhilOfWalton,
Thank you for your repply and very detailed explanation. It is always good to learn new programming methods.
After implementing your routine, error 3021 (No current record) appeared.
Also, ValveID is always giving me numbers (check image)
https://www.dropbox.com/s/45ijj37o0r...r3021.png?dl=0
Well, the error is eliminated if the routine
...Code:'Private Sub Form_BeforeUpdate(Cancel
Leave a comment:
-
PhilOfWalton,
Thank you for your answer. I will put here a sample of the table and form (in order to be easier to debug).
In the next image we can see the names of all fidels of my form:
Relatively to the Combobox/form, it is possible to analyse the details in the next image:
The form has Valves table as record source.
Thank you!...Leave a comment:
-
Combobox Selection not updating form bound fields
Dear Bytes community,
Framework: I have created a form using the "Form Design" tool. On the form property sheet, it was added to the Record Source the table which contained the fields that I wanted to update/add.
The fields from the table were introduced in the form using the "Add Existing Fields" button.
In the next step, in order to have the fields populated by a combobox selection, I added a combobox...
No activity results to display
Show More
Leave a comment: