Search results

  1. P

    Distinguish Capital and small letter in password.

    If you ad "Option Compare Binary" to your code it will work.
  2. P

    Syntax Error in Query

    In your code there are to many unnesseary () that corrupt your expression. The following works on my system. Expr1: IIf(IsNull([Actual_RL_3rd_Reimport]), IIf(IsNull([Actual_RL_2nd_Reimport]), [Actual_RL_1st_Reimport], [Actual_RL_2nd_Reimport]), [Actual_RL_3rd_Reimport]) Identing your...
  3. P

    Dates getting 'inverted' when imported from Excel

    I agree with Brian, dateserial will prevent these kind of errors. In VBA all dates are in US format and you need to format it that way to prevent these kind of results.
  4. P

    Receiving Error Code 3021

    Glad you got it working and understand how it's working. One note on my code, the part where I check the recordset isn't actually necessary but I found that with linked tables the recordcount will work then.
  5. P

    Receiving Error Code 3021

    Dmax/Dmin won't do you much good in this case. Because you are working with the complete data in your recordset it won't work. I altered your code and think this is close to what you are after. Public Function patientAdmit(patientName As String, startdate As Date) As Date Dim dbs As Database...
  6. P

    Receiving Error Code 3021

    I can't open the file in the moment (I'm viewing mobile). When I'm home I will. I gues you want to total all visits?
  7. P

    Receiving Error Code 3021

    The function will only give the last startdate, if you want to total it you need to loop the recordset. How is your database structure? How did you call the function?
  8. P

    Receiving Error Code 3021

    Untested and no errorhandling (You need one). Public Function dateStart(Patientname As String) As Date dateStart = DMax("startDate", "MyRecord", "patientName=" & Patientname) End Function Note: This would only get te latest date. Testing for the enddate would require the startdate also to...
  9. P

    Receiving Error Code 3021

    You get the same value for every record because the function does the same calculation every time. In order to work you should have give a parameter to the function like: Public Function dateStart(patient1 As String) As Date But if you do that it would be faster to use the Dmin and Dmax...
  10. P

    Attachment field not properly deleted if parent row is deleted

    From where do you link your tables? If it's from one other Access database you need to enforce relational integrity and enable cascading delete on the relation between the two tables in that database. If it's from two different databases you need to write some code to delete the attachment...
  11. P

    Defining "Yesterday"

    The error message should give you some clue. I'm no expert on DB2 but to me it seems that you can only use string values to filter, and the date() - 1 function returns a double. So changing it to something like: format(date() - 1, "mm/dd/yyyy" ) should solve this problem. Note: the error says...
  12. P

    Blank field problem when exporting with bookmarks

    I think the 'Type Mismatch' error is because Word can't handle null values so changing your code to something like: objWord.Selection.Text = Forms![members]![Street] & "" should resolve your error. By concatenating a field value with a ZLS it will always be a string.
  13. P

    "Like" query

    I think the red part is a typo. Are you sure that no space is added after the dot and that the filter criterea are between double quotes? So it looks like: like "Software.SA.*" A workaround could be: like "Software.SA*" and not like "*sap*"
  14. P

    "Like" query

    Like has to be used with a wilcard, in your case it would be: Like "A.A*" or Like "A.A.?"
  15. P

    Enter Parameter Value

    You probably used a sort order on EmpID in data view when you created the query, this is why you get query2.EmpID parameter question. If you sort the query now in data view and save it it should be gone.
  16. P

    Need help with DLookup syntax:

    First, I wouldn't use the lost focus event but the after update event of the txtProjectNumber control. The code only has to run when the value is changed and not when you leave the field when tabbing trough. I'm not sure why but I have had some problems with square brackets and using the form...
  17. P

    Datasheet/form view on opening

    The second parameter of the DoCmd.Openform function is te way the form is openened, to open in table view it should look like: DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria
  18. P

    CSV Import - Blank columns causing errors

    The last True in the docmd line means the first row has fieldnames changing it to False should do the trick. For more info lookup the help on TransferText.
  19. P

    Transfering a formula from a form into a table

    Why would you store the age? If you do you store age you'll have to update your table tomorrow to make sure the right age is stored for every entry. Values that can be calculated from info stored in the DB should not be stored but calculated when needed.
  20. P

    identifying words spelt incorrectly with numbers instead of letters

    I think it would be easier to select the record where the field has numbers, this can be done by putting like "*#*" in the selection criterea. Then you can manually edit them.
Back
Top Bottom