Search results

  1. B

    how to query the first 3 digits of a field

    I'm trying to export from a text file. However one of the fields contains 2 items of data, ie the code and name of a person. eg 'po2 Paul O Mahony'. What I want to do is query only the code(first 3 digits) from this field. ie 'po2'. Is there a way of doing this within a query (sql) or do I...
  2. B

    How to stop a form from closing after validating a field

    Hi, I've got a close button on my form as follows: Private Sub exitForm_Click() DoCmd.Close End Sub In the beforeupdate event of the form I have have following code to validate the forms fields: Private Sub Form_BeforeUpdate(Cancel As Integer) 'Place an asterisk (*) in the Tag Property...
  3. B

    Report that gives previous weeks data?

    Thanks, I got and answer to this question now.....date query criteria should read >=DateAdd("d",-7-(Weekday(Now())-1),Now()) And <=DateAdd("d",(-6-(Weekday(Now())-1)+6),Now())
  4. B

    Report that gives previous weeks data?

    I need to create a report that gives me the data from the previous accouting week. For example, if I try to display the report on a wednesday, it will give me the data from monday to sunday of the previous week. The same thing will happen if I print the report on thursday. I.E. I should still...
  5. B

    How to stop a form from closing if some essential fields are not populated

    thanks Mikk, but that doesnt really suit my purposes. The field in question can be a 0 value in certain circumstances, so what I want to do is set a condition that executes before the user closes the form. Here is the code, if that makes it clearer to you. Private Sub Form_BeforeUpdate(Cancel...
  6. B

    How to stop a form from closing if some essential fields are not populated

    Thanks for that Rich, I get a message saying that there is an error ...if you close object now, the data will be lost. I presume this is the generic message you get if the cancel state is true. Is it possible to replace the message with a more user friendly one, do you think?
  7. B

    How to stop a form from closing if some essential fields are not populated

    I tried putting the following code in the form unload procedure, but although it does generate the correct message, it doesnt stop the form from closing. Private Sub Form_Unload(Cancel As Integer) If [Starttime] > 0 And [Admin_time] = 0 Then response = MsgBox("Please click on the...
  8. B

    How create form that allows you to edit but not add new records.

    I guess this is a fairly basic one. I have a form that allows people to edit records, but I want to prevent people from adding new records on this form. I thought that if I put 'no' in the 'Allow additions' property, I would achieve this end, but when I do this, all the input boxes dissappear...
  9. B

    How to convert and private subroutine into a public one

    thanks for that Peter, I'm sorted now
  10. B

    How to convert and private subroutine into a public one

    thanks very much for this. It works a treat. I am getting an error though when the form opens (invalid use of null) which is caused by the call to this routine. not sure why this is happening, but the routine works in any event it appears.
  11. B

    How to convert and private subroutine into a public one

    Hi, I guess this is a bit of a newby question. I have 2 rather long but identical subroutines attached to 2 forms. I am going to be creating more forms that will use this subroutine, so I would like to have 1 public routine that I can call from all forms, rather then having to update several...
  12. B

    How to add fields to a table after a form has been created.

    Ahh! I see the error of my ways. Source of Form wasn't a table, it was a query... thanks for that:)
  13. B

    How to remove navigation from form

    muchos gracias
  14. B

    How to remove navigation from form

    I'm trying to create a form without the standard navigation arrows on the bottom of the form. Is it possible to hide these? I want to use my own navigation buttons instead as they will be more intuitive to non tech users. appreciate it
  15. B

    How to add fields to a table after a form has been created.

    Anybody able to help me with this. I think there should be a simple solution to it, but it eludes me at the moment. Basically, I have created a form in MsAccess with alot of vb script on it, but now I realise that I have to add more fields to the source table. If I insert a new unbound text box...
Back
Top Bottom