Search results

  1. A

    File list to text

    Sorry, I didn't read your original code carefully enough - I thought that RowSource referred to a text box on your form, rather than the listbox property by that name. Your For...Next loop results in all the file names in the folder being concatenated into the String variable StrRow, delimited...
  2. A

    File list to text

    Change the period before RowSource to an exclamation mark. In general, a period indicates a property or method, while an exclamation point indicates a user-defined field.
  3. A

    Incrementing a number in a string

    Put the function code into any standard module (click the Modules tab, click New, enter the code, save and close the module). If you want the string to be constructed and assigned to the field MyText1 on form MyForm (which MUST be open in Form view at the time), you would need just this line...
  4. A

    stupid access.....??

    When I copy and paste your code into a sub and run it, I get an error message stating that the variable ws is not defined.; When I put in a Dim statement to define it as a workspace variable, the code runs OK until this statement: tmplabel = Array(lblchk1, lblchk2, lblchk3, lblchk4, lblchk5)...
  5. A

    Access version of Session Variables ????

    I should have indicated SetUser as a sub, not a function, and used the word Public instead of Dim. The corrected code is: Option Compare Database Public PstrUserName As String Sub SetUser(UserName As String) PstrUserName = UserName End Sub Function GetUser() As String GetUser =...
  6. A

    Compeltion Pop Up Message

    Try putting your validation code in the BeforeUpdate event, setting Cancel to True if the validation fails.
  7. A

    ItemsSelected.Count not working

    Looks like it's solved now. Although I could find no mention of this in Microsoft's KnowledgeBase, it appears that the ItemsSelected collection (including its Count property) is "unreliable" - see http://www.rogersaccesslibrary.com/download.asp?SampleName='MultiSelectProblem.mdb' for examples...
  8. A

    slow saves and view-switching

    Access 97 running under Windows XP Professional
  9. A

    slow saves and view-switching

    I have a relatively small (1.5 MB) database. It contains an unbound form, which includes 4 combo boxes and 1 list box, all of them bound to tables or queries which return very few records. Whenever I save this form, or switch between Design and Form views, I get the hourglass for 10 to 30...
  10. A

    Access version of Session Variables ????

    As far as I know, Property Get and Property Let are typically used only in class modules, so if yours is a standard module, that may be part of the problem. In any case, if you put the following code in a standard module, you should be able to set or retrieve the variable value from anywhere in...
  11. A

    ItemsSelected.Count not working

    llkhoutx: The AfterUpdate event fires immediately after a control's value has been changed by the user. In the case of a list box, that means whenever the user clicks on one of the displayed items to change which item(s) is/are selected. In my form, this event always fires when it's supposed...
  12. A

    zipcodes, countries and that kind of stuff

    Set up a select query that combines the zipcode and place into a single calculated field, and also includes the region and country fields. On your form, add a combo box with the RowSource set to this query, 3 columns, and the BoundColumn set to the position of the calculated field. You can use...
  13. A

    ItemsSelected.Count not working

    What llkhoutx and Rich are suggesting (looping through all the elements of the ItemsSelected collection in order to sum them) is what I'm already doing to calculate the new sum. The problem remains - for whatever reason, the collection does not seem to reflect the latest selection or...
  14. A

    Incrementing a number in a string

    If CurNum is your current highest number, and MyDate is the date whose year you want to use, you can construct the string you want with the following code: Function NewInvNum (CurNum As Long, MyDate As Date) Dim lYear As Long, lNum As Long Dim sYear As String, sNum As String lYear =...
  15. A

    ItemsSelected.Count not working

    I'm running Access 97 under Windows XP. On an unbound form, I have an unbound list box (lstItems) whose MultiSelect property is set to Extended, and whose RowSource is a select query; some of the query's criteria are based on the values in other fields on the same form. The application...
  16. A

    Duplicate field from one record to the next

    I'm not sure what else to suggest. The error message "The Microsoft Jet database engine can't find a record in the table <name> with key matching field(s) <name>." is usually caused by attempting to update or save a record on the many side of a one-to-many relationship when there is no matching...
  17. A

    Duplicate field from one record to the next

    My guess is that the problem does not relate to form vs. subform, but rather a problem with the way your subform is set up. You might want to use the subform wizard to insert one form into another, to ensure that critical properties are set properly. Then go back and compare the properties of...
  18. A

    Convert text to number? ie number(text) or?

    Assuming: Dim S as String, L as Long S = [some string value] L = [some long value] you can convert a string to its numeric equivalent by: L = Val(S) or convert the numeric to its string equivalent by: S = Format(L) or S = CStr(L) or S = Str(L) There are subtle differences between Format...
  19. A

    Obtain List of Tables in Remote dB

    Parsing the table names is easy, assuming you know exactly what the part before the date is (as seems to be the case here). Using your example (the "Task_Orderedmm/dd/yy" tables, where the part before the date is 12 characters), the following expressing will isolate just the date part (replace...
  20. A

    format text in combobox

    You can set a text box's text color as follows: MyTextBox.ForeColor = [some long integer value] To get an idea of what the numeric value is for each of your desired colors, simply go into the Properties window, manually select each color for this property, and note what the resulting value is...
Back
Top Bottom