I Have to press F9, to show changes on not related tables.

L

Lars Pedersen

I have proberly done this the wrong way to start with.

I have:
tblShip
tblSources
tblSourcesRel

frmShip (based on tblShip)
fsubSources (a subform on frmShip based on tblSourcesRel - related to
tblShip on foreignKey/ID basis, one-to-many relations)

Whenever you want data into the subform, you select from a dropdownbox from
tblSources, this tblSources is not related to any, so therefore changes made
to tblSources at current session is not reflected. You have to press F9 to
recalculate (or re-enter the database)
I was thinking about sending keys "Sendkeys "F9" ", but I got this feeling
that there is a better approach to this.

Its a database of shipwrecks, and the user select their sources of
information from a libary of books in tblSources.

Any suggestions would appreciated.

/Lars
 
A

Allen Browne

Use the AfterUpdate event procedure of the *form* where you enter the new
records, to requery the combo in the subform.

This kind of thing:

Private Sub Form_AfterUpdate()
Forms!frmShip![NameOfYourSubformControlHere].Form![NameOfYourCombo].Requery
End Sub
 
L

Lars Pedersen

Thanks, that worked.

/Lars

Allen Browne said:
Use the AfterUpdate event procedure of the *form* where you enter the new
records, to requery the combo in the subform.

This kind of thing:

Private Sub Form_AfterUpdate()

Forms!frmShip![NameOfYourSubformControlHere].Form![NameOfYourCombo].Requery
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Lars Pedersen said:
I have proberly done this the wrong way to start with.

I have:
tblShip
tblSources
tblSourcesRel

frmShip (based on tblShip)
fsubSources (a subform on frmShip based on tblSourcesRel - related to
tblShip on foreignKey/ID basis, one-to-many relations)

Whenever you want data into the subform, you select from a dropdownbox
from tblSources, this tblSources is not related to any, so therefore
changes made to tblSources at current session is not reflected. You have
to press F9 to recalculate (or re-enter the database)
I was thinking about sending keys "Sendkeys "F9" ", but I got this
feeling that there is a better approach to this.

Its a database of shipwrecks, and the user select their sources of
information from a libary of books in tblSources.

Any suggestions would appreciated.

/Lars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top