Search results

  1. E

    Checkbox in Option Group

    You're checking to see if the box is filled in while its already too late!! Do you understand what the code is doing? All those lines that start with rs! are actually writing the record to your table. By the time you're checking to see if a field is null, you've already written the record...
  2. E

    Call Database Name

    Acutally, I got that all wrong :-) CurrentDb.Name will get you the full path of the db, including the name. The function I posted will get you just the path of the db, without the name, but it could be easily modified to give you just the name.
  3. E

    Checkbox in Option Group

    You are using an unbound form. Therefore, there is no before update event!! You need to put it on your save button.
  4. E

    Call Database Name

    You can use CurrentDb.Name to get the name, or the below function to get the full path. Function GetDBLocation() As String Dim db As Database Set db = CurrentDb GetDBLocation = Left(db.Name, Len(db.Name) - Len(Dir(db.Name))) Set db = Nothing End Function
  5. E

    Checkbox in Option Group

    If isnull(me.txtField) Then msgbox "You must complete Field 1.",vbokonly+vbinformation, "Missing Field 1" exit sub End If Do that for each field you want to check. If you want to be nice to your users, you could code it to check each box before exiting the sub and display one error...
  6. E

    Adding a new record with certain fields filled

    On the click event of your button, use: DoCmd.GoToRecord , , acNewRec to go to a new record. Then you can use: me.txtField1 = "Value1" me.txtField2 = "Value2" and so on to set values of certain fields.
  7. E

    Duplicate Warning form to appear on screen

    Is it stopping on a certain part of the code? Does it do anything? Please provide more detail than simply the fact that it is not working.
  8. E

    formating number within text string

    First, I would question if this is really the best way to be storing this data. I mean, someone is only going to be 23 for a year! But, if you insist, you will need to use string functions. InStr will search a string for a value InStrRev will serach the string backwards Len will tell you the...
  9. E

    Choosing values from a list box

    Sure its possible. Check out this link for an example of how to do it with combo boxes: http://www.fontstuff.com/access/acctut10.htm
  10. E

    Which box to use

    You can control what column your ComboBox is displaying. In its control source, you would include two fields (in this order): ID, Textfield You would then set the bound column to 1. Under format, set the column count to 2, and set the column widths to 0" This will hide the first column, and...
  11. E

    Date Criteria

    You can use: IN (SELECT Max([AuditDate]) FROM tblAudit) as the criteria for your AuditDate field in your query.
  12. E

    How to find duplicated records?

    What you want is to use a "Fuzzy" search, which Neil is right - Access does not do. However, if you search this database and the internet for Fuzzy Logic or Fuzzy Matching, you might find some interesting info. You can start with this thread...
  13. E

    Select Equal type - Based On Random Query

    My initial reaction is to write 5 queries, one for each set. The queries would choose 5 questions at random in that particular set. Then, you could use a Union Query to bring the results together into one query. I'm not sure if there is a better way than this or not...
  14. E

    Date Value

    You might want to include year as well, otherwise you'll get January 2001, 2002, etc. all lumped together as January.
  15. E

    Request for help on Database design

    Read up on Data Normalization. After briefly skimming your requirements, I would think you would want the following tables: tblPupil -PupilID (autonumber, PK) -FirstName -SurName -etc. tblTask -TaskID (autonumber, pk) -TaskName -TaskDesc -etc tblPupilTask -PupilTaskID (autonumber, PK)...
  16. E

    Checkbox in Option Group

    All you have to do is test the controls to see if they have a value. If they do not, then don't write the record to your database! Again, though, I must ask why you have two save routines that run (that appear to be pretty similar) and why you are using an unbound form??
  17. E

    Checkbox in Option Group

    Any reason you are using an unbound form?? Any reason that you have two save routines that do the same thing?? Anyway, I fixed it. Since your form is unbound, you want to calculate the value of your option group when you save the record, not after you update the group. See attached...
  18. E

    Checkbox in Option Group

    If you want, post the db and I'll take a look.
  19. E

    field counter, display no. of occurences in a table on a form

    OK, assuming you have a text box on your form that contains the customer ID you are searching for, and it is called txtCustomerID: =DCount("[CustomerID]", "[Bookings]", "[CustomerID] = " & txtCustomerID Put that in the control source of an unbound text box.
  20. E

    Run Code within code.. Newbie Question

    Just use this in the code of your button, after you do everything else: call combo1_AfterUpdate()
Back
Top Bottom