Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code help!

Status
Not open for further replies.

katiekat

Technical User
Jun 6, 2000
300
US
Here's what I want to be happen: A user would go into the database, and when the database window opens, a message box will appear if certian tables have been updated, or reccords had been added. This would happen until someone goes in and checks out the tables. <br><br>Here's what I know how to do: Make the message box. I think there must be a way to do all this, but I do not have the knowlage to do it all. I would really appreciate some help. <br><br>Thank You!<br>Kate
 
make a new module and in this module declare a boolean type variable and set it to false. On the before update statements of the forms that are controled by the tables you want to know about then set the variable to true. <br><br>With the opening form have the messge box in an if else statement that checks your&nbsp;&nbsp;boolean variable that you declared earlier. <p>Walt III<br><a href=mailto:SAElukewl@netscape.net>SAElukewl@netscape.net</a><br><a href=
 
Does it matter that the way these tables get updated is a data access page? And I have almost no idea what you meant by that message. I'm sorry, I have very little experience coding. Wait, after the 10th time reading it, I have a vague idea of what is going on. Very fuzzy one though. Could you please elaborate just a little bit? I would really, really really appreciate your help!!!
 
It's a web page attached to the db.....OHHH!! dur. The pages have underlying forms.&nbsp;&nbsp;Meaning I made data access pages from forms that return their data to a table.
 
The first thing you need to do is go to the Module tab and select new.<br>Then you will see two lines of code. on the first blank line type<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dim changed as boolean<br><br>The next step is to go to the opening form. <br>if you look at the form in design view there is a button that will show the code.<br>(it has two or three colors looks kinda funny hit that button and you will see the code window.)<br>In this window are two textfields and and a textarea in the first textfield choose Form from the drop down menu.<br>Then in the second textfield choose Open if it is not already chosen. then in the code <br>section between (Sub Form_Open()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;&nbsp;&nbsp;&nbsp;end sub) you need to add<br><br>&nbsp;&nbsp;&nbsp;&nbsp;if changed then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(your message box)<br>&nbsp;&nbsp;&nbsp;&nbsp;end if<br>Then you need to set changed.<br>Go to the form that you want to check and see if it has changed. <br>Bring up the code screen again and choose form from the first textfield. <br>&nbsp;in the second field choose AfterUpdate. <br>then in the sub like before <br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;changed = true<br>&nbsp;&nbsp;&nbsp;<br><br>this should work for you. You may have to mess around with it a little to get it to work for your application.&nbsp;&nbsp; <p>Walt III<br><a href=mailto:SAElukewl@netscape.net>SAElukewl@netscape.net</a><br><a href=
 
Thank you very very much! I am going to give this a whirl on monday. I really appreciate you taking the time to help me!!!! <br>Thanks again!!!<br>Kate
 
I am kind of confused. Sorry! If you even read this again, or anyone does, this is my problem. First. When I open a new module, all I see is Option Compare Database. I don't see 2 lines of code. Just wondering if that matters. I don't get what you mean by &quot;Then you have to set changed&quot;. Actually, after that statement, you lost me. I am not sure what code screen you are talking about, the form one or the module one? I am sorry if I am a little slow, but I am very new at this. I really appreciate your help. =)!!!
 
katie, if you look under the FAQ tab in this forum, there is an entry under the Forms category named something like &quot;datestamp records&quot;. This is similar to what you want to accomplish in terms of capturing when changes occurred. You're a bit vague about what your second criteria would be &quot;until someone goes in and checks out the tables&quot;. Maybe you'd like to define that as a third set (see FAQ) of datestamp & userID? <br><br>In terms of workflow, rather than a message box you might consider a separate form for the validation person that simply pulls up all the data that has been changed or added with no 3rd set. Then they just pull it up whenever they have a moment.
 
Thanks Elizabeth! That is a really good idea. I always try to get way more complicated than I need to, and usually, I don't know how to accomplish my magical ideas. =) I guess that's the way you learn though, and I certianly need to be learning more of this! <br>
 
Glad that seems to be of help :) And if you're still pretty new to Access,&nbsp;&nbsp;if you haven't yet, you may want to look over the Northwind and Developer Solutions databses included with Access as samples. They give you a good idea of ow a lot of common functions are accomplished. You save time by doing things a standard way, instead of having to reinvent the wheel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top