Missing linked child subform

  • Thread starter Thread starter Bob N. Betts
  • Start date Start date
B

Bob N. Betts

I am currently making a small library management software using access.... I
am sending you the application....

Anyway my problem is.... if you open the publication "form" you will notice
that there is a child form..... query loans..... the query loans of course
is the history of the books loan records....... Problem started when i added
my own buttons the add edit save and delete... the link between the parent
and the child doesn't work anymore... in fact if you noticed you can't even
input in the child form anymore... it's all gray??

Anyway please send your reply also to (e-mail address removed) so i can open my mail
at home...
 
I am currently making a small library management software using access.... I
am sending you the application....

No, you're not, there was no attachment to this message; and if you
were to upload the database, very few or none of the volunteers here
would even download it, much less open it. Binary attachments are NOT
welcome in this text-based newsgroup.
Anyway my problem is.... if you open the publication "form" you will notice
that there is a child form..... query loans..... the query loans of course
is the history of the books loan records....... Problem started when i added
my own buttons the add edit save and delete... the link between the parent
and the child doesn't work anymore... in fact if you noticed you can't even
input in the child form anymore... it's all gray??

What are the Recordsource properties of the Form and of the Subform
(post the SQL, or if it's a table name just post that)? What are the
Master Link Field and Child Link Field properties of the Subform
control?
Anyway please send your reply also to (e-mail address removed) so i can open my mail
at home...

Done, but please reply *TO THE NEWSGROUP*; replies by EMail will
generate an invoice for consulting services or no response at all.
 
John...

That's the main reason... why I didn't put any attachment..... I've been
subscribing to this newsgroup for more than a year and first time I
encountered someone answer with full of warnings and your reply was kind of
somewhat rude.... Some of the MVPs I've talked to sometimes request for
attachment sent to them directly...... but i only send them upon their
request...

Anyway ..... I've already checked the properties for the SQL
 
Apologies to you John if i misinterpreted your reply..

I think I misinterpreted your post: you opened it with
I am currently making a small library management software using access.... I
am sending you the application....

which implied to me that you had intended to attach the application to
your message. If you were instead inviting someone to request that you
send them a copy of the database, that is quite different and I do
apologize for my lecture.

Again: I really think I might be able to make some suggestions if you
would kindly reply to my questions:

What are the Recordsource properties of the Form and of the Subform
(post the SQL, or if it's a table name just post that)? What are the
Master Link Field and Child Link Field properties of the Subform
control?
 
Thanks for the patience and understanding.... now I remember I forgot to
delete that line because I copied and pasted it from previous mail which i
sent to another access user....

Anyway ....

I hope this is right...

This is the SQL statement which I got from the properties of the sub
form.... I clicked the subform and copied and pasted the SQL view.... The
linking field is the "ID" field for both tables....

SELECT tblPUB.*, qryLOANS.Borrower, qryLOANS.[Date Borrowed], qryLOANS.[Date
Returned], qryLOANS.[Date Difference]
FROM qryLOANS INNER JOIN tblPUB ON qryLOANS.ID = tblPUB.ID;

Is this information sufficient?

Thanks.
 
This is the SQL statement which I got from the properties of the sub
form.... I clicked the subform and copied and pasted the SQL view.... The
linking field is the "ID" field for both tables....

SELECT tblPUB.*, qryLOANS.Borrower, qryLOANS.[Date Borrowed], qryLOANS.[Date
Returned], qryLOANS.[Date Difference]
FROM qryLOANS INNER JOIN tblPUB ON qryLOANS.ID = tblPUB.ID;

Is this information sufficient?

Yes, I think so. It appears that you are trying to do the same job two
different ways at the same time! With a Form and Subform arrangement,
it is NOT appropriate to include both tables in either form's
Recordsource. The mainform should be based on the "one" side table, or
a query using that table; the Subform should be based on the "many"
side table. You're apparently basing the subform on this query (itself
based on another query!), incorporating both tblPub and qryLoans.
 
I posted the same buttons in the subform.... it looks funny though since
looks like duplicate... is there a way for me to use just one set of
buttons..... most of the code inside the button are docmd.runcommand
accsaverecord etc...
 
John... the codes for the button are:



Private Sub Command19_Click()
On Error GoTo Err_Command19_Click


DoCmd.RunCommand acCmdRecordsGoToNew

Exit_Command19_Click:
Exit Sub

Err_Command19_Click:
MsgBox Err.Description
Resume Exit_Command19_Click

End Sub
Private Sub Command20_Click()
DoCmd.SetWarnings False
If MsgBox("Confirm deletion of the record?", _
vbQuestion + vbYesNo + vbDefaultButton2, _
"Delete?") = vbYes Then
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
End If
Exit_cmdDelete_Click:
DoCmd.SetWarnings True
Exit Sub
Err_cmdDelete_Click:
MsgBox Err.Description
Resume Exit_cmdDelete_Click


Exit_Command20_Click:
Exit Sub

Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click

End Sub



Private Sub Command21_Click()
DoCmd.RunCommand acCmdSelectRecord
Me.AllowEdits = True
MsgBox "The form is now in edit mode"
End Sub

Private Sub Command22_Click()
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Record Saved"
Me.AllowEdits = False
MsgBox "Edit Now Uneditable"



End Sub

Private Sub Form_AfterUpdate()
Me.AllowEdits = False
End Sub
 
Back
Top