Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2005
    Posts
    3

    Unanswered: Conditional Statements in Access 2000

    Hi,

    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)
    then
    Update a particular field as follows : new entry=current entry + incre
    else
    Create new record with that primary key;
    Set corresponding field = incre
    Endif

    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.

    Thanks !

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    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...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Jan 2005
    Posts
    3
    Hi,

    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.

    Hope this makes clear my motivation.

    Thanks !
    Last edited by trend05; 02-01-05 at 02:16.

  4. #4
    Join Date
    Nov 2004
    Posts
    32
    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.

  5. #5
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi trend05 and "Welcome to the Forum"

    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,
    BUD

  6. #6
    Join Date
    Jan 2005
    Posts
    3
    Thanks for everyone's input.

    Is there a good place I could read/learn about VB wrt Access 2000 ? I've done C and a little bit of Java, and so I basically need a quick start to VB and its related concepts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •