Search results

  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
  16. B

    Setting value

    Hi Many thanks in advance I have a form with 3 subforms on tabs. On the individualtreatment subform, the user can enter a date as a startdate for therapy. The user is then asked if they want to remove the patient from the appropriate waiting list (triggered in the after update). The idea is...
  17. B

    Tabbed subforms

    No, sorry, I don't think I have been very clear. Short answer: I am trying to get it so, if the user enters a start date for a therapy, they are re-directed to the end date of the waiting list subform, or just that the tab page that the waiting list subform is on, is opened up. Long Answer: I...
  18. B

    Tabbed subforms

    Sure: the main form is frm_patientdetails (tab control is tabctrl1) the subforms are sf_jun_waitinglist (control is offdate), sf_jun_individualevent (control is startdate). I would like it so that when the user enters an startdate on sf_jun_waitinglist (i.e. when someone starts a therapy) they...
  19. B

    Tabbed subforms

    Thanks Bob - you are exceptionally generous with your time. Firstly, I will try it in the After Update event Secondly, the form is name jun... which is short for junction. So it sf (subform) jun (jun) waitinglist. When I began this, I named them so because it was based on a junction table...
  20. B

    Tabbed subforms

    thanks for your response Bob I get what you are saying about the different between subform and the container it is in. However, I still can't get it to work. Me.tabctrl1.Pages("Waiting Lists").SetFocus Me.sf_jun_waitinglist.Form.startdate.SetFocus the code stops on tabctrl1 saying method or...
Back
Top Bottom