Search results

  1. S

    Price calculations between dates

    Is it going round the Do While loop? Does it ever call Function DaysPrice?
  2. S

    Price calculations between dates

    Steve We really need to check the content of the variables. If holding the cursor over variable names while the code is running doesn't display the values, you'll have to use another method. You could use "Debug and Add Watch" but it's probably simpler to insert some Msgbox statements. Change...
  3. S

    Price calculations between dates

    Steve Just reread the thread - I'd lost sight of the problem! Your problem is that some variable does not contain valid data. Insert the line TotalCost = 0 after the line i = 0. Insert a breakpoint on the line ThisDate = ... and run the code again. On each line position the cursor over...
  4. S

    Price calculations between dates

    Morning Steve To create a new command button, open the form in Design view and make sure you can see the Toolbox (select Toolbox from the View menu). Scroll along to the command button and click it. Next, move across to the form and draw a button. Delete the old button and name the new one...
  5. S

    Price calculations between dates

    Steve Not sure what else to suggest. I presume you've checked that it's calculating DaysPrice correctly. I am running Access 97 (SR2) on W95. Not sure if another version and/or windows platform would make a difference. Sorry but I am about to leave the office and I'm not back til Friday...
  6. S

    Making a New Record

    Don't think the Append query approach is correct. Try this insteaad: Sub AddNewRecord() Dim MyRst As Recordset Set MyRst = CurrentDb.OpenRecordset("tblLoans", dbOpenDynaset) With MyRst .AddNew !MemberID = Forms!frmLoanMember!MemberID !CDNumber =...
  7. S

    Price calculations between dates

    Steve To insert a breakpoint, click in the left-hand margin on the line which begins "ThisDate = ..." The line should then be highlight in brown (well it's brown on my pc!) Next select press F5, enter your data and click the Cost button. The code will stop at the breakpoint. Press F8 to step...
  8. S

    Price calculations between dates

    Steve Not sure why it's not working on your pc. Try putting a breakpoint in cmdCost_click so that you can see where it's falling over. shay
  9. S

    Random

    Try Randomize RandomNo = Int(9999 * Rnd + 1) The first line initialises the random number generator and the second line gives you a number between 1 and 9999. hth shay :cool:
  10. S

    newbie - adding a where clause

    This may be nothing to do with your actual problem but I'd always advise against using Date as a field or control name to be sure of avoiding conflicts with the Date function. shay
  11. S

    layout of form needs chaging?

    Not sure if I should have been able to see a screen dump of your form but I couldn't! Have you thought about using the Tab control? You could then spilt your controls into sensible groups eg supplier info, order info, delivery info and so on. Using tabs makes things easier on the eye and...
  12. S

    Price calculations between dates

    Steve I think you will have to redesign your product table so that it stores the room type and season start & end dates separately rather than have a product description field. I've created and attached an example mdb for you which gives a possible solution. The code behind the form looks up...
  13. S

    Price calculations between dates

    Steve Having the software calc the total price from the Hotel name, room type and dates is 'doable' but what I haven't fully understood is the structure of the table which stores dates and prices. Do you have HotelId, SeasonStartDate, SeasonEndDate, RoomType and Price for example? shay
  14. S

    Price calculations between dates

    Steve Can you explain a bit more about how the seasons/dates info is stored? Given any date, how do you decide if it's High or Low season? Attach your file if that's easier. shay
  15. S

    Price calculations between dates

    Hi I understand what you want to do but how is the pricing info store? shay
  16. S

    saving form as a word document for e-mail purpose

    Hi One way to do this would be to use the OutputTo command. See if this example helps: Private Sub cmdOutputToWord_Click() Docmd.OutputTo acOutputForm, "Example frm", acFormatRTF Exit Sub You'll need to substitute 'Example frm' and 'cmdOutputToWord' with the name of your form and...
  17. S

    Activate

    Try this: Put this line of code in the AfterUpdate event of the field you will be updating manually: me.txtDate = date NB I've called the text box which displays the date txtDate. hth shay :cool:
  18. S

    RecordSource\ControlSource problems

    Hi there Try this: DoCmd.OpenForm "frmCommentsPopup", acNormal Forms!frmCommentsPopUp.RecordSource = SQLString hth shay :cool:
  19. S

    Spaces in SQL Statement

    Try this: "SELECT [ClientName] & " " & [PoolAddress] AS ClientDetail, " & _ "[FirstName] & " " & [LastName] AS ClientName, [StreetNumber] " & _ "& " " & [StreetName] & " " & [RoadType] & " " & [Locality] & " " & " & _ "[PCode] AS PoolAddress, tblServJob.JobDate, tblServJob.TimePromised, " & _...
  20. S

    Please Help with Pop up form

    Hope I've understood the problem correctly - I think you want to end up with each Department secretary's info on the Department report. What you should not do is copy the info from the Secretary table to the Employee table (bad db design to have the same info stored more than once) - keep the...
Back
Top Bottom