User Profile

Collapse

Profile Sidebar

Collapse
topher23
topher23
Last Activity: Apr 14 '14, 09:52 PM
Joined: Oct 30 '08
Location: Price, Utah, USA
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • When to Use Layouts: The Synergy of Layouts and Anchors in MS Access 2010

    A layout provides a grouping method for controls on a form or report. The two default layout types are Tabular (labels in form header, controls in detail), and Stacked (labels to the left, controls to the right, all in detail). Regardless of which layout you choose, you can edit it afterward to work any way you please.

    You apply a layout under the Arrange tab, in the Table group. Layouts in Access are an emulation of HTML tables, which...
    See more | Go to post
    Last edited by Niheel; Apr 14 '14, 11:03 PM.

  • I realized that the method I gave you (not giving the path) is actually a solution for when you call BrowseTo from inside the subform. However, I think I see now what the real issue is. When you specify the path to the subform, the BrowseTo statement expects a change in the SourceObject. However, since you're calling out the same form that is already loaded, it's not re-opening the subform in the new DataMode. The only way I can think of to change...
    See more | Go to post

    Leave a comment:


  • Since it's the second issue, try just using
    Code:
    DoCmd.BrowseTo acBrowseToForm, "frmEmployee", , , , acFormAdd
    For some very strange reason not addressed by Microsoft, the PathToSubFormCo ntrol variable seems to override the DataMode. So, although it's not intuitive to leave the Path variable blank, it should fix the DataMode. Let us know if that solves the problem.
    See more | Go to post

    Leave a comment:


  • topher23
    replied to how to check a field from another table
    Got it. WantedName is a string, correct? Use instead
    Code:
    StPassenger = Nz(DLookup("WantedName", "WantedList", "WantedName = '" & Nz(Me.PassengerName.Value) & "'"))
    THis wraps the control value in string literals. Otherwise what's being passed to the table looks like
    Code:
    WantedName = Billy The Kid
    The table can't parse that statement, since "Billy" would be interpreted as a variable and...
    See more | Go to post
    Last edited by topher23; Mar 5 '14, 05:13 PM. Reason: clarification

    Leave a comment:


  • Since a splitform does, in effect, create two instances of a form, it's probable that an object module-level variable would never work. If you don't want to explicitly use a global variable, perhaps a TempVar which is created when you need it and removed as soon as you don't would strike your fancy. With that, you could bypass OpenArgs altogether.
    See more | Go to post

    Leave a comment:


  • What is the context in which you're using this command? FWIW, I only know of two "issues" with BrowseTo. First and foremost, the form needs to be open in order for it to work (it isn't an implicit OpenForm). Second, if you are running data from a form and just trying to change the data mode of a subform on that form, entering the Path statement can cause it to fail. I think it's more likely that the second one is your issue, but without...
    See more | Go to post

    Leave a comment:


  • topher23
    replied to Convert a filled in form into report
    The best way to do this is to have your form fill in a table with a unique record ID, then when the user clicks the button, save the record and pass the record's ID number from the form as filter criteria to the report, which is also pulling its data from the same table the user just entered the data into. Forms and reports don't actually "hold" the data, the data should always be held in one or more tables. If you don't want the data saved,...
    See more | Go to post

    Leave a comment:


  • topher23
    replied to how to check a field from another table
    Your function usage is still flawed. DLookup returns a matching string.
    Your code should read:
    Code:
    Private Sub PassengerName_Exit(Cancel As Integer)
    Dim StPassenger As String
    
    StPassenger = Nz(DLookup("wantedName", "WantedList", "WantedName = " & Nz(Me.PassengerName.Value))) 'Nz will turn null results into blanks, a good practice to use
    
    If Not StPassenger = "" Then
    ...
    See more | Go to post

    Leave a comment:


  • topher23
    replied to Changing mouse cursor
    It's been a few years, but for anyone stumbling upon this post: Don't forget to set
    Code:
    Screen.MousePointer = 0 'Access default
    after you're done with whatever required the explicit pointer. So if you have Access change the pointer in an image's MouseOver event in the Detail section, put the code for returning to default in the Detail section's MouseOver event.

    Also, relating to bluray's comment, if buttons in the 2007+ versions of Access...
    See more | Go to post
    Last edited by topher23; Mar 5 '14, 03:53 PM. Reason: spelling

    Leave a comment:


  • Hmmm, looks like I may have been wrong about modules. I remembered reading in the past that you could use Sheets([modulename]) just like Modules([modulename]) in Access, but I just tried it and it didn't work. Further reading leads me to the belief that my memory on that may have been faulty. The Sheets collection only consists of the objects that show up as tabs in the GUI, which can also be referenced through the collections relating to their specific...
    See more | Go to post

    Leave a comment:


  • 1. Late binding because there are several different versions of Excel in use at our company, so this eliminates broken references.
    2. I used to use Worksheets more often, but the Sheets collection allows direct reference to worksheets, chart "sheets", and modules (instead of just standard worksheets), so I tend to use that instead when coding.
    3. I've had Activesheet give me unpredictable results with automation in the past,...
    See more | Go to post

    Leave a comment:


  • Grrr! I just tacked a
    Code:
    DoEvents
    before the With block and now it works. Of all the ridiculous kludges!
    See more | Go to post

    Leave a comment:


  • Application-defined error when populating cells in late-bound Excel automation object

    I have an Access subroutine that needs to generate an Excel spreadsheet for accounting. I've used late-bound Excel automation before, but for some reason I keep running into a strange issue when I run this one.

    This is the relevant portion of the procedure:
    Code:
    Private Sub GenerateExplodedBOM()
    'On Error GoTo Err_Handler
    Dim appXL As Object
    Dim wbBOM As Object
    Dim rs As New adodb.Recordset
    ...
    See more | Go to post

  • topher23
    started a topic How to Export a Form or Report as a "Package"

    How to Export a Form or Report as a "Package"

    It happens often in Access development environments: you're working in one database, and you realize that you want to use a form or report in another database that you or your company are also developing. But when you import/export the object, you discover that a lot of the objects that it depends on (tables, queries, subforms/subreports) aren't in the other database and also need import/export. Eventually, you get everything transferred, but wonder...
    See more | Go to post

  • I tried out those Vista instructions - Win 7 and 8 actually don't have the same option, but they do have a combo box that has similar wording in it. Just to be certain, I downloaded 7+ Taskbar Tweaker and looked at the settings there, which shows "Group on Application ID" selected. I'm guessing that when I change the Current Database Name in Options, Access no longer claims it so the OS gives it its own Application ID. So... it looks like...
    See more | Go to post

    Leave a comment:


  • Is it possible to name a database and still treat it as a document?

    I'm developing a modular system in which each major function set is held in a different Access front end. I'd like to have all of the open front ends stack under one Windows start bar icon in order to maintain that relationship visibly and keep the start bar clean. Is it possible to name the databases in such a way that they have different names, but still stack under one icon? I've tried the most obvious solution (just insert dashes) but that doesn't...
    See more | Go to post

  • If you're going to use Outlook Automation like this, don't forget to add "Microsoft Outlook ##.# Object Library" as a Reference or use late binding, as discussed in this insight from Adezii: Early vs. Late Binding
    See more | Go to post

    Leave a comment:


  • topher23
    replied to What is wrong with this code..
    FYI, serial number implies series, as in "each instance comes after the last." An autonumber is a true serial number generator; it provides unique identifiers in series. If what you are doing is try to provide an identifier for something like a unique sort, this makes better sense.

    As to why this doesn't work, I'm concerned about bookno. In your commented sql string, you call it out as [book_no], but in the SQL that is executing...
    See more | Go to post

    Leave a comment:


  • topher23
    replied to Color certain text in red
    Make sure that your procedure is also set up to handle HTML. At least in the past, with Outlook automation, you could specify a body string as either
    Code:
    olMailItem.Body
    or as
    Code:
    olMailItem.HTMLbody
    .Body would always go as straight text, while .HTMLbody would parse the actual HTML.
    See more | Go to post

    Leave a comment:


  • According to Microsoft's website: Access 2010 supports a maximum of 64 connections per process with a limit of 256 concurrent open read/write connections per database.

    But your best practice will still be to split into FE/BE to reduce the chances of data corruption. A shared front-end with no data will be at risk of code/object corruption, but that can be handled with a good backup procedure. The back-end would then be safer from data...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...