Recent content by Bruce75

  1. B

    Me.Undo problem - no current record

    resolved problem by putting the code in the after_update event not sure why that worked, but happy it did!
  2. B

    Me.Undo problem - no current record

    thanks. i did that, now it comes up with a different error: "The value violates the validation rule for the field or record." Not sure how I am violating a valdidation rule if i am not entering any data. Any ideas?
  3. B

    Me.Undo problem - no current record

    hi I have a little bit of code that uses a DLookup to prevent users from entering duplicate values, as below: Private Sub groupIDFK_BeforeUpdate(Cancel As Integer) justchosen = Me.groupIDFK previouschosen = DLookup("groupIDFK", "jun_groupevent"...
  4. B

    GotoRecord problem

    thanks RG Actually an earlier post by your good self seems to have moved me on a little. I used dim rstc as dao.recordset and this has got rid of the invalid reference error, now I get a 'no current record' error as I move through the records! still, a change is a good as a break. cheers
  5. B

    GotoRecord problem

    after much searching I reckon it is because the eof only becomes true after the last record has been passed. So I have tried this instead: Private Sub postpone_Click() Dim rstc As Recordset Set rstc = Me.RecordsetClone rstc.MoveNext If rstc.EOF Then Set rstc = Nothing DoCmd.GoToRecord , ...
  6. B

    RecordCount problem

    thanks for that.. it does the job for me! cheers
  7. B

    GotoRecord problem

    Hi I know this problem has been posted by others in this forum, but I can't seem to get the solutions working. I have a button on a form that triggers a gotorecord acnext code. When it gets to the end of the recordset, I would like the user to be brought back to the first record. I have tried...
  8. B

    RecordCount problem

    Hi I have a form containing a subform. The form is based on a query. I would like it so that (1) if the user enters the form and the query returns no records, a warning appears and they are returned to the switchboard; and (2) if the query returns record(s), the user can cycle through the...
  9. B

    Append query problem

    I am such an idiot. I spent 6 hours trying to solve this problem and the solution was very simple. I just added the primary key of the source table to the query that the subform is based on, then included a form reference to it in the append query criteria. thanks for all your help though!
  10. B

    Append query problem

    Thanks ajetrumpet... i will try your suggestion and post my db. Best wishes Bruce
  11. B

    Append query problem

    Thanks ajetrumpet I am trying to do all the database in vba and queries. the update query sql that works is: UPDATE jun_waitingevent, jun_individualevent SET jun_waitingevent.offdate = [forms]![frm_patientdetails]![sf_jun_individualevent].[Form]![startdate] WHERE (((jun_waitingevent.offdate)...
  12. B

    Append query problem

    Hello again I have tried this in vba: Private Sub StartDate_AfterUpdate() Dim starttherapy As Variant Dim therapytype As Variant Dim UResponse As Integer Dim pid As Variant Const conNullError = 94 starttherapy = Me!startdate therapytype = Me!Type_of_Treatment pid = Me!patientIDFK UResponse =...
  13. B

    Append query problem

    thanks. I am a bit of a beginner but I dont think that is what I am after. I am building a patient database to record patient history in our service. The tables of importance, I think are: tbl_patientdetails patientID name, etc tbl_treatment treatmentID treatment group (yes/no) Junction...
  14. B

    Append query problem

    Hello I am having a problem with an append query. I want my database to create a single new record in a table using values from another. I guess an append query is used for this. I have this so far: INSERT INTO jun_waitingevent ( waitinglistevent_ID, offdate, waitinglistIDFK, patientIDFK )...
  15. B

    Setting value

    thanks, that works nicely and is much more simple than what i was trying to do. Bruce
Back
Top Bottom