Cydney,
One way this type of situation is often handled is to put a continuous
view form, based on 2nd table, as a subform on the 1st table form. Is
this an option for you? If so, I would expect your problem disappears.
Otherwise, I am not 100% clear in the interpretation of your question.
I assume you mean that at the moment clicking the button opens a
separate form for 2nd table records? And I assume you mean you want the
procedure to add a new table 2 record if there are *no* corresponding
table 2 records? If so, I suppose your Click event code could include
something like this...
If DCount("*","2nd table","[RecID]=" & Me.RecID)=0 Then
CurrentDb.Execute "INSERT INTO [2nd table] ( RecID ) VALUES ( " &
Me.RecID & " )"
End If
--
Steve Schapel, Microsoft Access MVP
Cydney wrote:
> Another basic question ... and my brain is fried... Please help.
> Two tables are linked by RecID (one to many with referential integrity
> added). The 1st table has RecID entered by AutoNumber upon the addition of
> new records. The 2nd table doesn't have the RecID (number field) filled in
> until a new record is added by clicking a button from the first table's form.
> I want the "onclick" to FIRST look to see if the record is there and then
> move to that record. If it is not there, then it needs to add the new record
> and assign the correct RecID to the new record in the 2nd table. I'm so
> close, but .... how...??
|