Search results

  1. jwhite

    display login name

    Public Function GetWinUserName() GetWinUserName = Environ("UserName") End Function Put that in a module (either 'fn_GetWinUserName' or in a library of routines) Then, in your report's OnOpen event, put this: lbl_Name.Caption = GetWinUserName
  2. jwhite

    text box alignment

    Change the "Vertical" property of the control to "Yes". That will display the value from top down. I am unaware how to make it display bottom up. If you find a way, please PM me.
  3. jwhite

    adding field to form and table - please help

    Error 2465 is "Microsoft Office Access can't find the field..." Did you re-link the tables from the Front-End?
  4. jwhite

    Report --> Sub Report Issues

    With the code below, I am so close -- in the SUB Report's RecordSource, I am trying to refer to the value of IDNum on the MAIN Report to select the records out of tblProjectsAssigned where IDNum is the same, and pull all of the EmpID's that match the IDNum. Below I believe I have copied all the...
  5. jwhite

    Combo Box

    No offense, but why do you want to do this? The users will know the CBO contains Sales/Resale/Overheads. Set the property "Auto Expand" to "Yes". Then when the users type "S", "Sales" will automatically be filled -- as you illustrated when you put a "1" in front of Sales. If the numbers 1-3...
  6. jwhite

    module code stops working

    I'm not sure either what you are saying, but... There are many sources for "Naming Conventions". For example, Microsoft. It isn't mandatory, but makes code alot easier to read and reduces problems later. Never have the control name the same as the source name. If you are copying code from...
  7. jwhite

    Importing CSV w/report title stripped out..

    If the sample data is EXACTLY the way the .csv file is, then use VBA Line Input to read-in the file until LEFT(strLineIn,5) = "date,", then start getting the data you need. To separate the field values, use the "," as the delimiter to break the line into field values.
  8. jwhite

    Incrementing Report Count

    Well, a little late but.... here's my 2 cents worth... I'm an 'Intermediate' fellow, so if the code below can be written better, please advise! :) Of course, you could move all of it to a Function. Table Name: _IncrementingReportCount CurYear = Current Year value...
  9. jwhite

    ********* really need help .Please take a look. last to finish************

    The problem is in your reference to the subforms. Syntax for referring to subforms from another object (query/report) is: Forms!Mainform!Subform1.Form!ControlName So, to reference control in frm_Agreements: Forms!frm_Customers!frm_Agreements.Form!CarId Hope that helps.
  10. jwhite

    open a specific form

    Try this in a module within the form (not tested). The parameter (strIn) is the value of the field to test: Private Sub FormToOpen(strIn) As String Dim strtemp As String strtemp = "" Select Case StrIn Case "1": strtemp = "frm1" Case "2": strtemp = "frm2"...
  11. jwhite

    Help with wildcards

    I'm a newbie too! :-) If you pick 1., you don't have to program anything. Where the user would type the string to search for, they can put the * before and/or after that string to do a wildcard search. If you pick 2., then you have to do alittle programming. In my trials, I added the *...
  12. jwhite

    Cannot select item in combo box ?!?!?!?

    Have a subform: Name: frmProjectSub1 Default View: Continuous Forms A combo box within the subform: Name: cboProjectName Control Source: Nothing Row Source Type: Table/Query Row Source: SELECT ProjectName FROM tblProjects WHERE tblProjects.Status LIKE "*" ORDER BY ProjectName...
  13. jwhite

    Help with wildcards

    Two ways to achieve this: 1. Let the User know that they can place a * before and/or after the text to search for -- typing ABC* would return ABC and ABC Company; typing ABC would return only ABC. 2. Programmitically include the * before/after the string to find. This would force a wildcard...
  14. jwhite

    Transfering RecordSource/OrderBy of form to Report

    Hmmph... I figured it out. I found the key, and then common sense kicked in telling me the report has to be open to receive the data, so I moved the lines to the OnOpen event of the report. Reports!rpt_frmTaskMain.RecordSource = Forms!frmTaskMain!frmTaskSub1.Form.RecordSource...
  15. jwhite

    Transfering RecordSource/OrderBy of form to Report

    I have a subform within a form that displays filtered data based on dynamic selection criteria which is assigned to the RecordSource/OrderBy of the subform. On this form, I have a "Print Results" button -- OnClick, I would like the RecordSource/OrderBy of the subform to be copied to the...
  16. jwhite

    VB script to run every 20 days

    Oops, sorry I wasn't clear.... In reference to "AutoReport module". This would be a module that you create in the VB window (Alt-G). Then, wherever you want to automatically check if the report needs to be printed, call this module. Perhaps in the Main Menu form -- change the OnLoad event to...
  17. jwhite

    Using DoCmd.OpenQuery in VB6.0

    Executing SQL Statements in VBA Code http://www.databasejournal.com/features/msaccess/article.php/3505836 Very good article with a demo db...
  18. jwhite

    Function to insert char into string

    Thought it might be useful for the function to also return the current date if you need... Option Compare Database Option Explicit Public Function Datefix(Optional inDate As String) 'If no date passed to function, use current date If inDate = "" Then inDate = Format(Date, "yyyymmdd")...
  19. jwhite

    VB script to run every 20 days

    An idea... Create a table/add to a table (whatever is best in your application) to store a date field called "LastRun". In an "AutoReport" module, use the datediff function to check if 20+ days have elapsed since last run, if so -- run it and update the LastRun field to current date... Hope...
Back
Top Bottom