Search results

  1. S

    Question about Keyascii and If/Then statements

    or on 1 line, If KeyAscii < 47 And KeyAscii <> 8 Or KeyAscii > 57 Then KeyAscii = 0
  2. S

    Variables and Filtering

    Hi try Dim strName as String strName = Inputbox ("Please enter name") DoCmd.OpenForm "Employees", , ,"LastName = '" & strName & "'" You have to be careful when using an apostrophy as a string delimeter, eg the above will fail if you put in a name of O'brien because the apostrophy in the name...
  3. S

    Locking an Excel cell from Access

    Hi I'm trying to lock a cell on an excel template, but from access. The Excel template is not my own and has 2 buttons which lock the upper and lower half of each sheet prompting the user to enter a password. I want to populate the upper half from access and lock those cells automatically...
  4. S

    replacing carriage return with funky square

    In the code you just supplied assuiming a line feed is the problem, replace If Mid([sorthotelinfo], counter, 1) = Chr(13) Then 'is it a cr? with If Mid([sorthotelinfo], counter, 1) = Chr(13) or Mid([sorthotelinfo], counter, 1) = Chr$(10) Then 'is it a cr? Hope that helps Paul
  5. S

    replacing carriage return with funky square

    I suspect there maybe a line feed control character immediatly after the carriage return. The Line feed ascii value is 10 and is not normally visible if a carriage return preceeds it. If you have a function to remove chr$(13)'s from your string, make it remove all chr$(10)'s as well. for...
  6. S

    What is the best way to insert Date/Null into a Date Field?

    I've had this problem before and just used an IF statement. if isdate(nz(MyDate)) = True then docmd.runsql "INSERT INTO MyTable (MyDate ) " & "VALUES ( Cdate('“ & MyDate & “'))” else docmd.runsql "INSERT INTO MyTable (MyDate ) VALUES (Null)” end if Easy way out I guess, there...
  7. S

    Form and table question

    Hi The obvious way would be to bind the form to the inventory table and change the control source on each combo/text box to the field in the inventory table. Assuming you have an unbound form and want to do it the other way, then in the 'on click' event for your button try. Docmd.RunSql...
  8. S

    Quick, stupid question for a braindead programmer

    Assuming txtMyString = "141# UP" for the first part:- txtMyText = left(txtMyString,3) and if the first number varies, then use instr on for the 2nd part as below. You may have to use instr for the 1st part also, if the number changes size. txtMyText = mid(txtMyString , instr(txtMyString,"# ")+2)
  9. S

    Finding records that match comma delimeted memo field

    Hi Timp I think I see what you mean. The query as it stands should work fine. I've re-created your tables and fields and produced a query which lists out results as you specify. SELECT tblRoleID.RoleID, tblRoleID.EmailAddress FROM tblRoleID, tblxCampPers WHERE (((InStr("," & [MailingList] &...
  10. S

    Dlookup quirk

    Yes, sorry my post assumed intUserID was an integer
  11. S

    Finding records that match comma delimeted memo field

    Hi You should be able to do this using the INSTR command. In the query below I had to add comma's to the beginning and end of your memo field so that when I search for ",1," is finds it. If you don't include comma's either end of your number then you would get RoleID 1 appearing when your...
  12. S

    Dlookup quirk

    Use NZ to zero the null value eg:- intUserID = NZ(DLookup("[user_id]", "[tblUsers]", "[user_login] = '" & strProvidedLogin & "'")) If intUserID = 0 then msgbox "Invalid":' do something else Hope that helps Paul
  13. S

    Reporting lines

    Hi Dave I did say is was a bit primative :) . You don't say how many records you have, but if its 1000's then it would have to run a query for each one ... not good. I'm not sure how well an array would work or what the limits are, so I'll leave that to someone else. I did have another look...
  14. S

    Reporting lines

    Hi Dave As a suggestion although this might be a bit primative, I would try to create a temp holding table for your results which contained ID (Autonum) & just the EmpID. In the 'On Click' event of the 1st box 1. Populate the temp table with the direct reporting employees and have your 2nd...
  15. S

    importing filename and content of file

    Hi Susanne Try this assuming you have a text box on your form called txtFileName and its contents are 'bruno.txt' :- DoCmd.TransferText acImportDelim, , "tblTmp", Me!Path + txtFileName DB.Execute "INSERT INTO tblCosts (name,costs) " & _ "select '" & left(txtFileName,len(txtFileName)-4) & "'...
  16. S

    Trying to update a checkbox in excel from access public sub

    Hi, I'm trying to update some Checkboxes which are in an Excel sheet, but I'm trying to do it from VBA in a public sub I have created in an Access Module. I have linked the Excel sheet and can change the cells using queries, but this will not change the checkboxes. I'm running Access 97 and...
Back
Top Bottom