I'm new to Microsoft Access and so this might probably be a v.basic question.
I'd basically like to do the following using simple queries (hopefully without the hassle of going into VB which I don't know !) :
IF (Record based on a primary key exists)
Update a particular field as follows : new entry=current entry + incre
Create new record with that primary key;
Set corresponding field = incre
I'd appreciate if you could provide me with some detailed info, and if it means going into VB or something similar, how I can start ! BTW, the database table (for a start) will simply consist of two columns : the first column being the primary key and the second the field I'd like to update.
This sounds a little wacky... could you describe a bit more detail about what you hope to accomplish here? My knee-jerk reaction is this may introduce some nasty integrity issues with keys being incremented using arbitrary seeds...
Our receptionist basically compiles (at the end of each month) a list of outgoing telephone calls and the charge levied on that call. For a start, I'd like her to be able to enter the tel number and corresponding charge. If a record exists for that particular number then of course the new charge should be added to whatever is in that corresponding field. If the record does not exist, it then should simply be created.
BTW, there'll probaby a third field to indicate who in the firm made that outgoing call. Eventually I'd like to be able create a fourth field which will indicate who the owner of the called number is - we have an Excel Spreadsheet mapping our clients with their corresponing tel number.
Can I be the first to state that I don't think that's a good idea.
Rather log every phone call and produce a report summarising the calls and cost. Just having the total cost in a column is not good practice.
You may find that it has worked on paper, but in database terms it just isn't good practice. I'd think you'll need at least two tables for what you're doing.
Otherwise use a form. Show the telephone number in a text box on the form, and the cost in another text box. Put a button on the form, when the button is clicked set thecost to textbox + inc. That should automatically update the table. And yes you will have to use vb to do that. You might also want another form with a list box of all the numbers, account names on it, when the user clicks the correct name, it should open the form we've just mentioned, and yes you'll need vb for that as well. But I wouldn't recommend either approach until you've thought seriously about the design of the database.
And let me add my 2 cents worth too....Both of the posters make very good suggestions. It seems that you are embarking on something that has yet to be carefully thought out, thereby being the lack of a real strategic plan. Already it seems as though you might want a bit more added. It's best to sit back, think it through and get your plan together now as best you can, allowing for future needs. Derrick made the suggestion of a Table for the with all the numbers, account names and numbers, etc. After all you don't want to have to Input the same ol redundant data in every time. Do sit back and think it through or you're in for a headache.
just helpful friendly advice,
have a nice one and hope you enjoy the forum,