TAB CONTROL updates

  • Thread starter RedHeadedMonster via AccessMonster.com
  • Start date
R

RedHeadedMonster via AccessMonster.com

I have a data entry form that is a series of Tabs. You go thru the tabs and
enter your data.

I have one tab [VALIDATION] where you assign an Investigator
[AssignInvestigator]. After an investigator has been assigned, I use a SQL
statement to insert the investigators name into the the Investigation table,
that works fine no problem. The problem is if, after you assign the
investigator's name, you click on the [INVESTIGATION] Tab, the investigators
name [INVESTIGATOR]is blank. Unless you go to a new record then come back to
this one, then it shows up, because, like I said the SQL statement works.

I've tried all kinds of Refresh and Requery statements, to occur on the
AfterUpdate of [AssignInvestigator]. Also on the GotFocus & OnCurrent
eventof the [INVESTIGATION] tab. Nothing is working.

Any suggestions?

Thanx!
RHM
 
M

Marshall Barton

RedHeadedMonster said:
I have a data entry form that is a series of Tabs. You go thru the tabs and
enter your data.

I have one tab [VALIDATION] where you assign an Investigator
[AssignInvestigator]. After an investigator has been assigned, I use a SQL
statement to insert the investigators name into the the Investigation table,
that works fine no problem. The problem is if, after you assign the
investigator's name, you click on the [INVESTIGATION] Tab, the investigators
name [INVESTIGATOR]is blank. Unless you go to a new record then come back to
this one, then it shows up, because, like I said the SQL statement works.

I've tried all kinds of Refresh and Requery statements, to occur on the
AfterUpdate of [AssignInvestigator]. Also on the GotFocus & OnCurrent
eventof the [INVESTIGATION] tab. Nothing is working.


Apparently, your form's record source query joins to the
Inverstigators table to get the name. In that case you need
to same the current record's PK, Requery the form and then
find the record with the saved PK.
 
R

RedHeadedMonster via AccessMonster.com

Actually I have a [ROSTER] table that lists everyones names & email addresses
that I use through a Combo box to select names. Then I insert the [NameID]
into the [INVESTIGATION] table.

What do you mean PK?

RHM

Marshall said:
I have a data entry form that is a series of Tabs. You go thru the tabs and
enter your data.
[quoted text clipped - 10 lines]
AfterUpdate of [AssignInvestigator]. Also on the GotFocus & OnCurrent
eventof the [INVESTIGATION] tab. Nothing is working.

Apparently, your form's record source query joins to the
Inverstigators table to get the name. In that case you need
to same the current record's PK, Requery the form and then
find the record with the saved PK.
 
R

RedHeadedMonster via AccessMonster.com

After trying enough things, I finally got my form to update.

I put a Me.Refresh into the On Enter Event for [INVESTIGATION]. Worked like
a charm.

Thanx for you ideas.

RHM

Marshall said:
PK is short for Primary Key.

Assuming an AutoNumber PK, the standard approach to deal
with getting a new entry in another table to show up in a
form's record source query is along these lines:

Dim lngPK As Long
. . .
lngPK = ...
db.Execute "INSERT INTO ...."
Me.Requery
Me.Recordset.FindFirst "PKfield=" & lngPK
Actually I have a [ROSTER] table that lists everyones names & email addresses
that I use through a Combo box to select names. Then I insert the [NameID]
[quoted text clipped - 12 lines]
 
M

Marshall Barton

PK is short for Primary Key.

Assuming an AutoNumber PK, the standard approach to deal
with getting a new entry in another table to show up in a
form's record source query is along these lines:

Dim lngPK As Long
. . .
lngPK = ...
db.Execute "INSERT INTO ...."
Me.Requery
Me.Recordset.FindFirst "PKfield=" & lngPK
--
Marsh
MVP [MS Access]

Actually I have a [ROSTER] table that lists everyones names & email addresses
that I use through a Combo box to select names. Then I insert the [NameID]
into the [INVESTIGATION] table.

What do you mean PK?


Marshall said:
I have a data entry form that is a series of Tabs. You go thru the tabs and
enter your data.
[quoted text clipped - 10 lines]
AfterUpdate of [AssignInvestigator]. Also on the GotFocus & OnCurrent
eventof the [INVESTIGATION] tab. Nothing is working.

Apparently, your form's record source query joins to the
Inverstigators table to get the name. In that case you need
to same the current record's PK, Requery the form and then
find the record with the saved PK.
 

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