At 05:05 PM 4/2/2011, Dave McCann wrote:
This is a current project, begun using 9.0 but now entirely in 9.1 so
I can't say if this did this in 9.0 as it was not this far along but
I'll try to test that and post back results.
Here are some details:
DB Grid in my form uses a 2-table view, in this case it involves Jobs
and Employees, I call the view JobTracking. The Jobs table contains
Job# and other information about a job, the Employees table Name and
other Employee data.
The DB Grid on this form is used to display a list of Jobs by Age,
Oldest first, showing Job#, Employee Name, Date, Status, and is for
display only as I'm using it kind of like a variable list view, etc.
No editing directly in this DB Grid it is strictly there to display
a list.
So I have a button on the form that will allow with one click the user
to update the Status of the selected job, to indicate the job has been
received into the office for processing. Something like the following:
UPDATE jobs SET jobstatus='WIP' jobreceived=.#date WHERE ID = .vid
RECALC TABLES
When this is performed, the DB Grid on this form reflects the update.
Now I have another button that opens a Form to edit the Job information
where I can edit Job Name or some other information in the Jobs table.
When I do that and save the data, return to the form with the DB Grid,
the altered data is not reflected. Have tried the various options to
RECALC TABLES (as above), PROPERTY statements to refresh and/or CLOSE
and OPEN the view per Razzak's suggestion, etc.
So to summarize:
The DB Grid View is a 2-table view, The edits are not from another
session of R:base, I am not trying to edit data in the View, but data
directly in one of the tables of the View, The changes made through
EEP UPDATE code (works) vs Edit Form (does not).
Excellent explanation, Dave!
Glad to see that you are able to notice the changes immediately when
using the UPDATE command to update one of the tables associated with
underlying view.
Once clicking on another button that opens a form to edit Job Information,
to edit data in Jobs table, how are you saving the data and closing the
form to get back to underlying DB Grid?
I suggest placing a button [Save and Close] on "Job Information Form"
with the following custom EEP to save changes and then close the form.
-- Button Custom EEP
SAVEROW
CLOSEWINDOW
RETURN
Then, before switching focus back to DBGrid, use the following PROPERTY
commands:
PROPERTY TABLE JobTracking 'CLOSE'
PROPERTY TABLE Jobs 'CLOSE'
PROPERTY TABLE Employees 'CLOSE'
PROPERTY TABLE Jobs 'OPEN'
PROPERTY TABLE Employees 'OPEN'
PROPERTY TABLE JobTracking 'OPEN'
PROPERTY <DBGridComponentID> SET_FOCUS 'TRUE'
-- Notice the sequence of closing and opening tables and associated view.
To summarize:
The "another button" that opens "Job Information Form" may look like this:
EDIT USING JobInformationform WHERE JobReceived =.#dDATE AND ID = .vID
{
Click on the [Save and Close] button to save data and close form
-- Button [Save and Close]
-- Form: JobInformationform
-- Button Custom EEP
SAVEROW
CLOSEWINDOW
RETURN
}
PROPERTY TABLE JobTracking 'CLOSE'
PROPERTY TABLE Jobs 'CLOSE'
PROPERTY TABLE Employees 'CLOSE'
PROPERTY TABLE Jobs 'OPEN'
PROPERTY TABLE Employees 'OPEN'
PROPERTY TABLE JobTracking 'OPEN'
PROPERTY <DBGridComponentID> SET_FOCUS 'TRUE'
RETURN
Hope that helps!
Following these suggestions and steps, if you still cannot figure it out,
send me a sample of your database and routines and let me see what else
you are missing in the whole schema of things (my schedule permitting).
Good luck on completing your project using R:BASE eXtreme 9.1!
Very Best R:egards,
Razzak.