Search results

  1. B

    How to Stop Next Button creating a new record?

    Hi I have created a next button that goes to the next record each time the user presses it. however when records finish, it tries to create a new record. Is there anyway to stop it once it reaches the last record. I don't want it used to create new records. Any suggestions will be very much...
  2. B

    Trap access messages that don't have numbers!

    I have set warning to false then true as in the code below. I wonder if you can tell me if that's a good idea and can it have any potential problems in the future? Private Sub cmdDelete_Click() Dim answer As String On Error GoTo Err_msg DoCmd.SetWarnings False answer = MsgBox("You...
  3. B

    Trap access messages that don't have numbers!

    I apologize I did not word it properly, I did not mean it was an error message. Ok a standard message :) I have tried the form's onError, but I don't know how to trap this particular message because I don't know its number. I wonder if you can provide an example please?
  4. B

    Trap access messages that don't have numbers!

    Hi Any one knows how to trap access messages that don't display an error number such as the delete error: Relationships that specify cascading deletes are about to cause 1 recod(s) in this table and in related tables to be deleted. The message above does not display a number and when I...
  5. B

    Requery a Form and Return Certain Record

    That's solved it. It just needed IsNull() and a couple of If Statments. Private Sub cmdRefresh_Click() Dim MyPK As Long DoCmd.RunCommand acCmdSaveRecord ' save record If IsNull(qryHouse2!HouseID.Value) And Not IsNull(Me.HouseID.Value) Then MyPK = Me!HouseID.Value ' save main form PK from...
  6. B

    Requery a Form and Return Certain Record

    I have actually managed to get it to partially work now. The error was being generated because I was using Me!MyPk.value and that was somehow being assigned the main form's PK's value where it should have been assigned the subform's PK's value. So I just used the subform name instead of Me and...
  7. B

    Requery a Form and Return Certain Record

    I tried to save the record before running the rest of the code using DoCmd.RunCommand acCmdSaveRecord. But it did not help. It is a form and subform scenario where the main form is linked to the subform through the same PK. When I add a new record, the record gets added to the subform and it...
  8. B

    Requery a Form and Return Certain Record

    This code has worked well with records that already exist. But if I add a new record, it does not work. I think it does not work because at the time I am pressing the button that has this code, the table has not generated a PK for my new record yet. Any suggestions on how to save the new record...
  9. B

    Requery a Form and Return Certain Record

    Hi Rabbie, Thanks for your help. Unfortunately, I did not know that the part that said "yourPKfieldname = " was a condition. Because it was wrapped in quotes, I thought that can be any text!!! I shall try it later. Thanks, B
  10. B

    Requery a Form and Return Certain Record

    Yes I have done that in my second code listing (Error2).
  11. B

    Requery a Form and Return Certain Record

    Answer to this Urgently needed please!!! I have tried your code RoyVidar; however, it did not work. I got two different erros. Error 1: The Microsoft Jet database engine does not recognize 'ThePkField' as a valid field name or expression. Error 1 was generated when I used the following code...
  12. B

    Requery a Form and Return Certain Record

    I do understand what a PK is! :) What I meant was I did not understand how to bookmark a record in my recordset. I was not sure whether it is done through properties of the PK field or through code. RoyVidar generously supplied an example which I still got to try, but thanks to both of you.
  13. B

    Requery a Form and Return Certain Record

    I am not sure I understand what you mean Pat Hartman. I have looked under properties of the PK on form and table desing levels; however, I could not see any option about bookmarks. I have also done a search in the help section of access and all I got was help about creating hyperlinks. I wonder...
  14. B

    Access aplication on website

    What version of Access are you using?
  15. B

    Requery a Form and Return Certain Record

    Hi, I want to requery a form from time to time; however, when that happens I want to return the record that was displayed at the time before the requerying. Now when I requery, it goes back to the first record. Any suggestions will be very much appreciated. Thanks, B
  16. B

    Cancel Adding New Record If Condition is True

    :) Will do. Thanks anyway.
  17. B

    Cancel Adding New Record If Condition is True

    Cool, I am thinking going back to the old code may be better. Although it may get slower over time, but it should always stop users entering double Plots per Phase. Any suggestions please?
  18. B

    Cancel Adding New Record If Condition is True

    Unfortunately, I have a few lookups on that table. Why would lookups affect DCount performance? Is there any way around that or probably my original code was better?
  19. B

    Cancel Adding New Record If Condition is True

    Actually, I have just discoverred that DCount isn't working with all records. When I debugged, I found out that for some records the Me!PhaseID is Null although the control on the form is displaying a Phase ID. I had that field locked, I unlocked it because I thought that what was causing this...
  20. B

    Cancel Adding New Record If Condition is True

    Cool, I found out what was wrong, I made a typo. Now it works pretty well. Thanks. What is the difference if any between using something like Me.ControlName and Me!ControlName?
Back
Top Bottom