Adding additional info to Notes field after closing and reopening

Zydeceltico

Registered User.
Local time
Today, 03:39
Joined
Dec 5, 2017
Messages
843
Hi all -

I have a table, tblInspectionEvent, that has many fields - one of which is Notes. The PK for this table is InspectionEvent_ID.

I have a form used for data entry for Notes. It is opened twice - always - at the beginning and end of an event that may take a few minutes or a few days.

That form has two buttons on it. When the form is first opened, one of the buttons is visible (cmdEventNotes) and the other (cmdAddtlNotes) is not.

The first time the form is opened the user clicks the visible button which opens a popup form (frmEventNotes) with a single long text box on it where the user types some notes (Notes). InspectionEvent_ID is passed to secondary data entry form via OpenArgs.
Then the user saves and closes that form and the orginal form. The typed notes are saved to the table underneath.

Later the user will return to the original form and the second button (cmdAddtlNotes) will be visible but not the cmdEventNotes button. Clicking cmdAddtlNotes opens another second form, frmAddtlNotes, again with InspectionEvent_ID being passed to frmAddtlNotes via OpenArgs and placed in an unbound tetxbox on frmAddtlNotes.

What I would like to happen is that when the value in OpenArgs is placed in the unbound textbox (txtInspectionEvent_ID) for the Dirty event to trigger a SQL statement or a filter which would search tblInspecitonEvent for the value in txtInspectionEvent_ID and return the previously typed text in field Notes and allow the user to add another sentence or two to the already existing Notes field.

Before I even try to mockup something for discussion, I am hoping to get some direction as to what types of procedures I could be looking at to get form A to B - in a general way.

As always - - thank you for all of your help and patience!

Tim
 
Sounds like you are over-complicating things, if you want to edit the previously enter note why don't you simply open that record using the WhereCondition parameter of the OpenForm method?

Cheers,
 
Hi Tim. I agree. Wouldn't it be simpler to just use a subform for the notes? Just curious...
 
Sounds like you are over-complicating things, if you want to edit the previously enter note why don't you simply open that record using the WhereCondition parameter of the OpenForm method?

Cheers,
Too close to the forest.................and still QUITE inexperienced - - - yet the moment you mention I totally get it and remember that there even was/is a WhereCondition :)

Excellent! Thank You!

Yet another little gem that I shan't forget.
 
Hi Tim. I agree. Wouldn't it be simpler to just use a subform for the notes? Just curious...
Hey DBGuy -

A subform would be great and make it much easier but I continue to be bound to this all going on a rugged tablet and screen real estate is expensive.

I just tried using the WhereCondition method of OpenForm and of course I have done or understand something incorrectly. Even after rereading MS Access Help page.

I put this code on the button on Form1: Private Sub cmdAddtlNotes_Click() DoCmd.OpenForm "frmAddtlLineStopNotes", _ WhereCondition:="txtInspectionEvent_ID=" & Me.InspectionEvent_FK End Sub Me.InspectionEvent_FK is a bound textbox on Form1 and is always populated with a value.

txtInspectionEvent_ID is the control on Form2 where that value is placed.

When I click the command button on Form1 I get a MsgBox asking for a parameter value for txtInspectionEvent_ID. I have something backwards somewhere.

The Record Source for Form2 is tblInspectionEvent which has many fields only three of them are found on Form2: Photos, Notes, and InspectionEvent_PK which is Control Source for txtInspectionEvent_ID.

Is anything jumping out at you?

To mockup this part of the db could take me hours because many many things "happen" with this form and all of THAT works perfectly - but it isn't simple to recreate.
 
Hey DBGuy -

A subform would be great and make it much easier but I continue to be bound to this all going on a rugged tablet and screen real estate is expensive.

I just tried using the WhereCondition method of OpenForm and of course I have done or understand something incorrectly. Even after rereading MS Access Help page.

I put this code on the button on Form1: Private Sub cmdAddtlNotes_Click() DoCmd.OpenForm "frmAddtlLineStopNotes", _ WhereCondition:="txtInspectionEvent_ID=" & Me.InspectionEvent_FK End Sub Me.InspectionEvent_FK is a bound textbox on Form1 and is always populated with a value.

txtInspectionEvent_ID is the control on Form2 where that value is placed.

When I click the command button on Form1 I get a MsgBox asking for a parameter value for txtInspectionEvent_ID. I have something backwards somewhere.

The Record Source for Form2 is tblInspectionEvent which has many fields only three of them are found on Form2: Photos, Notes, and InspectionEvent_PK which is Control Source for txtInspectionEvent_ID.

Is anything jumping out at you?

To mockup this part of the db could take me hours because many many things "happen" with this form and all of THAT works perfectly - but it isn't simple to recreate.
Hi. Just FYI, a subform doesn't have to be on display all the time. To save on form real estate, one approach is to use a Tab control.
 
So I got that worked out. Replaced txtInspectionEvent_ID witht he field name InspecitonEvent_PKfrom tblInspecitonEvent and Form2 opens as I expected it too with the original user-entered text in a textbox. great so far.

I didn't understand the MS Access help page.
 
Try:

DoCmd.OpenForm "frmAddtlLineStopNotes", _
WhereCondition:="[InspectionEvent_PK] =" & Me.InspectionEvent_FK
 
Try:

DoCmd.OpenForm "frmAddtlLineStopNotes", _
WhereCondition:="[InspectionEvent_PK] =" & Me.InspectionEvent_FK
Thanks. Yeah - I was not clear that the WhereCondition was asking for field name form the underlying table. I wish I used some of these procedures more often so I could remember things like that. :-)
 
Thanks. Yeah - I was not clear that the WhereCondition was asking for field name form the underlying table. I wish I used some of these procedures more often so I could remember things like that. :)
That and it's late on Friday and I'm still at work.
 

Users who are viewing this thread

Back
Top Bottom