Solved insert a new record to the query by form (1 Viewer)

MK1999

New member
Local time
Tomorrow, 01:11
Joined
Mar 30, 2022
Messages
24
hello
I have a query I use it to search for programs and when the user click on it it populate a form with all program information
Now I have another form to add new program and it add the information directly to the tables.. i want to add the new records to the query since the search and program information depend on it.. How it can be? The query im using is not updatable..
 

Ranman256

Well-known member
Local time
Today, 18:11
Joined
Apr 9, 2015
Messages
4,339
you dont add records to a query, you add to a table.
If you need to add records to more than 1 table, create a subform to connect to the extra tables.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 18:11
Joined
Feb 19, 2002
Messages
43,233
It isn't clear what you are trying to do so I'll just make some statements that might trigger something.
1. You should NEVER be opening queries and viewing them as part of normal operations. Queries should be bound to forms or reports. Only YOU, in the process of debugging or developing would ever just open a query to look at it.
2. If you have multiple forms open, one form will not necessarily update the other. When a form opens, Access opens its RecordSource in memory. Periodically, Access refreshes the RecordSet and will "see" changes to records that were selected originally and will "see" #deleted# for records that were deleted. New records will never show, nor will existing records whose criteria was changed such that they would have been selected had the query to populate the first object been run now.
3. It is generally poor practice to have multiple forms open at one time unless the newest one is a dialog form and must be closed in order to have access to the original form.
4. It is really poor practice to have multiple forms open to the same recordsource at the same time.
 

Users who are viewing this thread

Top Bottom