User Profile

Collapse

Profile Sidebar

Collapse
pelicanstuff
pelicanstuff
Last Activity: Oct 20 '10, 10:32 AM
Joined: Nov 22 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • BeforeUpdate cancel intermittently not working - my fault or not?

    Below is my code. Me.Confirmed is a checkbox. Sometimes the cancel at line 37 works when the user clicks "no", someetimes it doesn't.

    Is this my fault or someting else?

    Code:
    Private Sub Confirmed_BeforeUpdate(Cancel As Integer)
    If gcfHandleErrors Then On Error GoTo PROC_ERR
    PushCallStack "ConfirmDeployment"
    
    Dim strfield As String
    strfield = Me.ConsultantID & ""
    ...
    See more | Go to post

  • pelicanstuff
    replied to Else without If error on compile
    Many thanks. I think I need to read some books quite urgently.

    Don't worry about lines 2 and 3, they are for error handling. gcfHandleErrors is a global variable that determines whether debug mode is on or off.

    It looks like I did mean to use Elseif - I've managed to muddle along so far (learning as I go along), but clearly I need to do some proper research.

    Food for thought.
    See more | Go to post

    Leave a comment:


  • pelicanstuff
    replied to Else without If error on compile
    Nope, putting those in doesn't help, it breaks at the 'else' on line 38. Hmmmmm.
    See more | Go to post

    Leave a comment:


  • pelicanstuff
    started a topic Else without If error on compile

    Else without If error on compile

    Hi - Was wondering if anybody could tell me why this rather crappy code is giving me an 'Else without If' error on compile?
    All the Elses and Ifs look ok to me but there's a few.

    Code:
    Private Sub MySearchButtonClick()
    If gcfHandleErrors Then On Error GoTo PROC_ERR
      PushCallStack "MySearchButton"
    
    If Me.AllowFlexibility = True Then
            If Me.UseSpecialism = True And Me.UseCountryExperience
    ...
    See more | Go to post

  • Where is your query running from? I assumed that since you said it was to run on opening of the application, it would be run from the Form_Load() event of your default form like so:

    Code:
    Private Sub Form_Load()
    
    DoCmd.SetWarnings = false
    DoCmd.OpenQuery "YourQuery"
    DoCmd.SetWarnings = true
    
    End Sub
    Or is that not how you're doing it?...
    See more | Go to post

    Leave a comment:


  • Before the line in the VBA that runs the query add "DoCmd.SetWarni ngs = false"

    Afterwards add "DoCmd.SetWarni ngs = true"

    I think that's right, but I'm newish....
    See more | Go to post

    Leave a comment:


  • pelicanstuff
    started a topic [SQL] Ambiguous outer join

    [SQL] Ambiguous outer join

    Just wondering if anyone can help me avoid the "Ambiguous outer join" error in the following bit of SQL:

    Code:
    TRANSFORM Count(Tbl_events.DateTime) AS CountOfDateTime
    SELECT Tbl_Grid.GridSquare
    FROM (Tbl_Grid LEFT JOIN Tbl_Locations ON Tbl_Grid.ID = Tbl_Locations.GridSquare)
    INNER JOIN Tbl_events ON Tbl_Locations.ID = Tbl_events.Tbl_Locations_ID
    GROUP BY Tbl_Grid.GridSquare
    ORDER BY Tbl_Grid.GridSquare
    ...
    See more | Go to post

  • Many thanks... in the end I actually found another way of doing this with a bit of lateral thinking. Can't remember it offhand right now as I'm at a different computer.
    See more | Go to post

    Leave a comment:


  • How about if I wanted the five most recent for each person?... This seems a little trickier.
    See more | Go to post

    Leave a comment:


  • pelicanstuff
    replied to Sensible table structure?
    Many thanks for all your help.

    Now I only need to solve the problem of having my specification changed every couple of days :)
    See more | Go to post

    Leave a comment:


  • pelicanstuff
    replied to Sensible table structure?
    Great, I'll give this way a go. Should I have a field 'projecttype' with three possible values ('tender' 'job' and 'special') to distinguish between them in that case, or should I rely on checking which fields are filled and which fields are not to determine this?
    See more | Go to post

    Leave a comment:


  • pelicanstuff
    replied to Open many forms from one form
    I've done something similar for my project - it might not be what you've been looking for, though.


    Code:
    Private Sub Form_Load()
    Me.Visible = False
    If DCount("*", "ExpiryQuery1") > 0 Then
        DoCmd.OpenForm "ExpiryForm1", acFormDS, , , acFormReadOnly
      
        Else
            If DCount("*", "ExpiryQuery2") > 0 Then
            DoCmd.OpenForm
    ...
    See more | Go to post

    Leave a comment:


  • pelicanstuff
    replied to Sensible table structure?
    Ok then, thanks.

    Re: treating the status as a type of project, is it ok to have so many of the table fields left blank (as they would end up in this situation, unless I misunderstand you) ?
    See more | Go to post

    Leave a comment:


  • pelicanstuff
    replied to Sensible table structure?
    Many thanks to all three of you.



    My timespan table contains timespans for which a person to be assigned to either a project or (provisionally) to a tender - the main function of the application is to keep track of a large number of personnel. Hence, a person can be assigned to many projects (both in the present and the future) and many persons can be assigned to a project. Many different projects and tenders occur simultaneously,...
    See more | Go to post

    Leave a comment:


  • pelicanstuff
    started a topic Sensible table structure?

    Sensible table structure?

    I'm working on an access application, part of which involves assigning personnel to different projects for different amounts of time. So far, so good.

    The problem I'm having is that the projects can be either projected (tendered for) or firm. Projects that have been tendered for have different attributes to those that are firm.

    The way I've tried to do this is having a Tender table, a Projects table, a Timespan table,...
    See more | Go to post

  • Many thanks - this worked very well.
    See more | Go to post

    Leave a comment:


  • Querying Most recent for different categories of object.

    Hi,

    I'm having a bit of trouble visualising how I would go about constructing a query that does the following:

    I have a table 'passports' and a table 'persons', where each person can have more than one passport, as you would expect. The persons I am dealing with mainly have dual nationality. Obviously it is very easy to display, say, all of the US passports or all of the passports for a particular person.
    ...
    See more | Go to post

  • You're certainly right in that it could be far more functional, but this'll probably do for now - this is my main form (multi-page) and has a vast, vast number of subforms, so I want to keep things as easy as possible for now considering I'm not particularly au fait with coding.

    Many thanks......
    See more | Go to post

    Leave a comment:


  • That's the odd thing, I did already set Order By in the form design - running this code seems to somehow 'un-set' it.

    I managed to re-sort it by putting those in after DoCmd.Showallre cords, and it seems to be working, cross fingers. I'm not so familiar with this stuff, and didn't know what the code for 'order by' was, so many thanks for the help....
    See more | Go to post

    Leave a comment:


  • Sorting records in form after text search command

    I found some code for text-searching in forms (using an unbound text box and a command button), and adapted it to look like this:

    Code:
    Private Sub Command83_Click()
    Dim strPersonRef As String
        Dim strSearch As String
        
    'Check txtSearch for Null value or Nill Entry first.
    
        If IsNull(Me![txtsearch]) Or (Me![txtsearch]) = "" Or (Me![txtsearch]) = "Surname" Then
    ...
    See more | Go to post
No activity results to display
Show More
Working...