Append Query from Unbound Textbox to subform

  • Thread starter Denis Bisson via AccessMonster.com
  • Start date
D

Denis Bisson via AccessMonster.com

Good day,

First, here is a list of tables, PKs and associated forms


TblMuseum, MuseumID, frmMuseum
TblArtifact, ArtifactID, sfrmArtifact
TblSwipeDetails, SwipeDetailID, sfrmSwipeDetails



Relationships: Museum can have many Artifacts; each Artifact can have many
SwipeDetails.

Forms: frmMuseum contains sfrmArtifacts, which in turn contains
sfrmSwipeDetails (datasheet view).

Without going into specific details as to WHY I want what I am looking for,
this is what I want to accomplish:

On the On_Exit event of an unbound texbox [txtSwipeTemp] found on
sfrmArtifact, I want to be able to populate (Append) that value to the
Swipe_No textbox (data Type – Text) found on sfrmSwipeDetails (Swipe_No is a
field within tblSwipeDetails).

I assume the best way to approach this is via an Append Query - something
with which I have very limited experience. Note that the value contained in
[txtSwipeTemp] would be programatically removed once it has been appended.

Not quite sure how to tackle this, and your assistance would be greatly
appreciated.

Thank you
 
M

[MVP] S.Clark

You're mixing UI(populate unbound text box) and backend db(append query)
concepts together, and
it makes things cloudy.

Since txtSwipe is bound to the table, the I/O is handled for you, so no need
for the Append query. Use VBA on the UI to handle the update:

txtSwipe = txtSwipeTemp

--
Steve Clark, Access MVP
FMS, Inc.
Call us for all of your Access Development Needs!
1-888-220-6234
(e-mail address removed)
www.fmsinc.com/consulting
 
D

Denis Bisson via AccessMonster.com

Thanks for your reply, Steve.

I see what you're saying, but txtSwipe is on - say- subform2, and
txtSwipeTemp is on subform1 (subform2 is not embedded into subform1, but it
is the Many side of the relationship between the two subforms (tblArtifacts
being the RecordSource to subform1 and tblSwipeDetails being the RecordSource
to suform2).

For instance, say we are on subform1 - the artifact (record) is an altimeter.
The user may 'swipe' it for radioactivity and assigns it a Swipe_No of 1002.
.... this time..... A year down the road the altimeter may be swiped again,
this time with a Swipe_No of 1159.

I designed the database so that the Swipe_No is entered directly into
subform2 (txtSwipe) and it IS working. What I am now trying to do is to
'accomodate' the user by having the Swipe_No entered via an unbound field so
that he doesn't have to scroll to the subform everytime a record is entered
(we are talking thousands..).

I will attempt something like: forms!sfrmSwipeDetails!txtSwipe = forms!
Artifact!txtSwipeTemp (I don't have the database at home), but I question
whether it will 'append' to a new record in the tblSwipeDetails each time a
record is added.

Sorry for the lengthy and confusing post.

Denis

[MVP] S.Clark said:
You're mixing UI(populate unbound text box) and backend db(append query)
concepts together, and
it makes things cloudy.

Since txtSwipe is bound to the table, the I/O is handled for you, so no need
for the Append query. Use VBA on the UI to handle the update:

txtSwipe = txtSwipeTemp
Good day,
[quoted text clipped - 29 lines]
Thank you
 

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

Top