Solved

connect to columns after edit event for inserting records in a different database/table

Posted on 2007-04-10
14
229 Views
Last Modified: 2013-12-25
Hi, I am trying to hook up to a column's afteredit or afterpost event.  The purpose is to trigger a record insertion  in another database/table when the cell's value changes from NULL/BLANK to a datetime value.

have tried connecting to the columns change and updated events, but the code is not run.

0
Comment
Question by:Bianca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
14 Comments
 
LVL 75
ID: 18886200
Should this maybe be in the SQL zone?

mx
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18886216
Are you trying this from a form of some kind?

Private Sub MyField_AfterUpdate()
'if myfield isn't null then do your thing
If Nz(myfield, "") <> "" Then
'Do your insert thing here
End If
End Sub
0
 

Author Comment

by:Bianca
ID: 18889625
Sorry, more explanation is needed...
I am trying to connect to an event fired by MSFlexGrid when a certain columns value changes from either NULL or BLANK to any value. I don't care about the value, I just need to trigger a record insertion in another database/table. Business logic is: when a user enters a date in the complete column (msflexgrid) then insert the job into the manufacturing database/table.

0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 

Author Comment

by:Bianca
ID: 18889630
one more thing... this vbscript in an access database.  The grid is on a form.
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18889702
Open that form in design view. Select the column, view it's properties....is there not an On_Change, or After_Update event for that column you're referring to?
If not, right click on the flexgrid object itself and select properties, there should be a build event option there also...come back and let us know.
J
0
 

Author Comment

by:Bianca
ID: 18890065
I do not have access to a column object, but the grid has an onUpdated event.  The grid is dynamically populated in the forms open event with sql queries.
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18890313
so how about using the Matrix property?

it's used like so

Grid1.TextMatrix(3,3) = "55"

Where 3,3 is the row and column.

you can test values that way and compare on the onUpdate event?

Not sure exactly how you want to approach it.
0
 

Author Comment

by:Bianca
ID: 18890393
I am not sure what event to connect to.  the msflexgrid is activex and only has the on updated event.  it passes (code as integer).
I can test for the value with textmatrix, but how will i know it was the column whose value changed?

how about if I just connect to the forms on key up event, make sure I am on the desired column and the columns value is not NULL or blank and do the insert from there?
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18890521
I created a small form with this kind of control on it. And there's just not much to it is there. I can set it's recordsource, I can capture when it's updated at the form level.
You think I can talk you out of using this particular control? maybe a subform control would work better? You can load a recordset into it...you have full control over each field...thoughts?
0
 

Author Comment

by:Bianca
ID: 18890593
we are in the process of migrating out of the access table/application. Problem is it is a legacy application and needs this enhancement until it is converted.  I found out the form events do not fire for the grid.  Is this something I cannot achieve with this object?  If so, I will report it and move on to my next task.
thanks
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18890850
see if you have this event available with your control

Private Sub ActiveXCtl0_SelChange()
MsgBox "selchange"
End Sub

I'm able to pop the msgbox using that code for my control when I click into a cell....any cell.

Of use to you?
0
 

Author Comment

by:Bianca
ID: 18891100
I don't have that event to connect to... the grid (msflexgrid) only has on updated,enter,exit, got focus and lost focus events.  Besides, that would put me IN the cell, I need to process after cell contents have changed.
This looks like a lost cause to me... will have to wait until we rewrite that section of legacy apps.
What do you think?
0
 
LVL 34

Accepted Solution

by:
jefftwilley earned 500 total points
ID: 18891149
trash it...not worth the time. You still have the data, and there are other ways of presenting it. Just because you can do something...doesn't mean you should.
My .02
J
0
 

Author Comment

by:Bianca
ID: 18891252
thanks for your persistence Jeff...
Awarding on last comment
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Suggested Courses
Course of the Month9 days, 8 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question