IF THEN where???

mebaby333

New member
Local time
Today, 15:07
Joined
Oct 2, 2013
Messages
7
I am trying to work with an Access Database that is nearly 100%linked tables to a SQL database.

I am attempting to understand where the best place(query, form, or what) to place an IF THEN ELSE statement that will check on what is in one field and if it is not null it will place the amount in the field into another field and then update the data...


Ha Ha ... according to your tips I would probably say I don't know much but I know I want to ;) and that may be all I need to know.... ha ha sorry speaking in song
 
That's a little cryptic, but depending on the specifics either in the form (most likely) or a trigger in the SQL Server table. Why would you want the same data in two fields anyway?
 
Sorry.. I did try to be straight forward ...

So one user checks a field to see if product is received then inputs the date if it has that was "promised".. her doing this allows for the job to enter into the schedule..
 
if you are ENTERING data, and need to do something depending on what has been entered - then the best place is in the FORM'S AFTERUPDATE EVENT

anything else, such as the control's before or after update event, or the form's before update event could be cancelled

the form's afterupdate event occurs after a record has been written to the database. therefore if you need to do some processing dependent on something in the record this is the best place to do it

I share paul's observation about data duplication. the idea of a database is to avoid storing the same data more than once. however if you need to store something that may change subsequently then it may be necessary to do what you want.

one other point is - do you only want to store the data for a new record entry, or do you want to store it whenever if the record changes.
 
I just figured I could automate it. The challenge is I am still getting familiar with the systems they have in place and the data trails.
 
Okay... so basically there is a date entered in at the time the order is quoted after the customer supplied parts are received then the date due needs to be updated to bring it into a schedule. Currently a user looks through a form and looks for "blanks" with the received date and manually updates the appropriate field and then the job is scheduled.

The date the kit is actually received into is updated in the SQL database and then the user pulls up the form and checks...

I am still getting familiar with all the database trails at my company....
 
technically the date is already there when the form is loaded because it is pulling the data...
would it be better to create a button that would preform the check? or is there an event on the form loading that I could put it?

What would be Best Practice?
 

Users who are viewing this thread

Back
Top Bottom