Search results

  1. Drevlin

    # sign added to end of value

    Your number is too long for a long integer. Long Int Range is -2,147,483,648 to 2,147,483,647 Try using Single or Double instead of Long. Access will still place the # sign after your number but the sign won't be passed to the variable. If you had tried to run your sub it should have given...
  2. Drevlin

    Getting The Name Of a Pressed Command Button

    Could you post your code for button2? You need to make sure that you are passing the button that is pressed: Private Sub btn_Aircraft_Selector_Plane02_Click() whichButton btn_Aircraft_Selector_Plane02 End Sub It sounds like you have this: Private Sub btn_Aircraft_Selector_Plane02_Click()...
  3. Drevlin

    Getting The Name Of a Pressed Command Button

    I think changing "as CommandButton" to "As Control" should get it to work. I'll explain what we're trying to do though, so you can undestand it and reuse it in the future if necessary. (or to give someone the chance to correct me if I misunderstand something) Ok, simply put we are having the...
  4. Drevlin

    Getting The Name Of a Pressed Command Button

    I'm sorry I was being stupid. It's CommandButton not Button. Or you could use Control as well.
  5. Drevlin

    Getting The Name Of a Pressed Command Button

    You say you have twenty-two buttons. The only thing you would need to repeat twenty two times is the call to your function from each button: Private Sub btn_Aircraft_Selector_Plane01_Click() whichButton btn_Aircraft_Selector_Plane01 End Sub Private Sub btn_Aircraft_Selector_Plane02_Click()...
  6. Drevlin

    If IsNull Then fo multiple controls

    There is no need for nested if statements in this case. Just do a check for each of your Controls one after the other: If IsNull(cntrl1) Then MsgBox "You must yadda yadda yadda", vbOKOnly + vbCritical, "Error" cntrl1.SetFocus End End If If IsNull(cntrl2) Then MsgBox "You must yadda yadda...
  7. Drevlin

    Setting Default Values Using VBA

    I'm totally not looking (or even thinking) this over so I may be WAAAAAAYYYYYY off base. But are you saying you need to do this: 'Set Default Values If IsNull(rstSelectedField.Fields("DefaultValue")) Then If Not IsNull(rstSelectedField.Fields("FieldDefaultValue")) Then...
  8. Drevlin

    Help with arrays

    You have three problems. The first problem is you have your declaration of your array before you set the Base: Global strContainer() Options Base 1 This won't work because you've already set an array and VBA won't allow you to ReDim it in this fashion. The second fix is: you need to drop...
  9. Drevlin

    Multiselect Listbox

    This is what your sequel statement says at the moment: SELECT CompanyID, Company Name Company Name FROM qrycompdet WHERE CompanyID... The bold part is where you're having a problem. I'm assuming you only want one Company Name and it should be in brackets. stSQL = "SELECT CompanyID, [Company...
  10. Drevlin

    Arrays

    A recordset is itself (in affect) an array. It's a single item that holds many variables. You can create an array that holds information that you pull from the recordset. A table is also an array. Lets say you create an array: Dim myArray(5, 10) This in affect is a table. You would say...
  11. Drevlin

    Arrays

    Arrays are helpful if you have a list of items that you need to pass from one space to another. The file dialog box is a good example. If you allow multiselect then you need to be able to have a single variable that can except multiple instances. The following is a snippet of code that pulls...
  12. Drevlin

    Silent Queries

    DoCmd.SetWarnings False ' the code that brings up the warnings you want disabled DoCmd.SetWarnings True
  13. Drevlin

    DoCmd.TransferSpreadsheet ERROR

    Well according to the error box you posted for some reason the file name is getting a "$" attached to the end of it. It must be getting added to the string somehow but if it just comes over that way do a: str = Left(str, Len(str)-1) to drop it off.
  14. Drevlin

    DoCmd.TransferSpreadsheet ERROR

    What version of access and windows are you using? I had no problem importing a file with a hyphen in the name. (used your filename actually) I'm on Windows NT and Access 2002.
  15. Drevlin

    Code to copy (.mdb) file to PC?

    Or you could: 1) Create a table in the "master" db that keeps track of version numbers for each of your forms and tables. 2) Create the same table for the "client" databases. 3) Create a startup form that runs a check between the two tables Master - Client. (this could be done with a simple...
  16. Drevlin

    import text file

    If and Then need to be on the same line. You have: IF [FORM].[F-TEST FUNCTION].[SEMESTER]= FALL01 THEN But it should be If [FORM].[F-TEST FUNCTION].[SEMESTER]= FALL01 Then Are you expecting the User to be typing in: C:\SQR\FALL01.TXT into the textbox? That would be the only way this...
  17. Drevlin

    error 2001

    Ok, I was out late drinking last night and not in best form (no pun intended) today. Does the error you are receiving actually SAY "at the line Me.RecordSource = OpenArgs"? When I read your statement I thought perhaps it was opening up the code and highlighting that line as being where the...
  18. Drevlin

    error 2001

    Strangely I don't see a line: Me.RecordSource = OpenArgs in your code anywhere. I did notice that you might want to put a space between the * and the " at the end of this line: StrSql = "SELECT TBL_PATIENT.*, TBL_SPELL.*" _ As you have it now your StrSql would read: SELECT TBL_PATIENT.*...
  19. Drevlin

    anybody have CHARACTER?

    This code is a bit simpler, it places a space whenever a non Numeric or Alphabetic key is hit: Private Sub Text10_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case 97 To 122, 65 To 90, 48 To 57, 32, 8 '8 is to allow for bkspace KeyAscii = KeyAscii Case Else KeyAscii = 32 End Select End...
  20. Drevlin

    Recordsets

    No... the only reason I used Str() was because I was thinking you were using a number. It may not be necessary at all, but since putting two parts together with "&" is a string thing I thought it best to convert the numbers to a string and then concatenate them together. But since your...
Back
Top Bottom