Form calling a 2nd form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

MS Access 2002 as a frontend, SQL server 2k as backend
I have a primary form that calls a 2nd form with matching ClientID. In most cases, a new record is established in the 2nd form which houses child records to the parent table in the 1st form. This works well until I add a couple of additional tables in the form query of the 2nd form. These additional tables have LEFT JOINs because in most cases, there are no matching records in those tables. The point of the 2nd form is to get records into all these tables.

This code is on form 1 under button that calls form2
set g = form

'if there is no record for this ClientID, establish on
If IsNull(g!ClientID) The
g!ClientID = Me.ClientI
Me.Dirty = False 'commit edi
End I

This code is successful as long as form2 query has only the one child table. When I add the other tables with LEFT JOINs, I get an error message "you can't assign a value to this object" pointing to the 2nd line of code above
Looking for help
Thanks so much
Josh W
 
Josh,

There is a good Help topic in Access about this. Do a search on
'recordset' keyword, and then look for the topic "When can I update data
from a query?" I think the problem in your case is that there needs to
be an existing record in the central table of your second query before
it can be updateable. You might have to do this process in two steps,
e.g. use an Append Query to enter your data as required, and then open
the form.
 
Back
Top