User Profile

Collapse

Profile Sidebar

Collapse
banderson
banderson
Last Activity: May 9 '12, 02:16 PM
Joined: Aug 17 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Thanks for your responses SmileyOne and ADezii!

    The pop up form is opened directly from the combo box, which means the combo box is the active control. Thus, the simple code SmileyOne suggested worked like a charm!
    Code:
    Docmd.Close 
    Screen.ActiveControl.Requery
    I love when the answer makes it more simple!
    For what is is worth, I tried ADezii's code and that worked as well. Will keep it in my "toolbox"...
    See more | Go to post

    Leave a comment:


  • banderson
    started a topic Conditional code is stopping at first condition

    Conditional code is stopping at first condition

    Hello,
    I am not sure why this code is not working. I have a pop-form to edit a drop down list that is found in a control (combo box) on 8 different forms.

    On this pop-up form, I have added a "Done" command button. When this button is clicked, I want to requery the control (combo box) on whichever main form is open so that the drop down list includes any edits or new entries that were made on the pop-up form.
    ...
    See more | Go to post

  • The "MoveLast" did the trick!
    Thanks, as always, theSmileyOne!

    And I'll just reiterate, generally, how helpful the Bytes forum has been for me!!!

    Below is the working code that
    - opens a new record in a recordset,
    - copies values from a form into the fields of the new recordset
    - moves to the last (newly added) record in the recordset
    - copies the ID field from this record...
    See more | Go to post

    Leave a comment:


  • how to copy a value from an active record in an open recordset

    Hello Bytes,
    I am having trouble copying a value from an open record in a recordset into a form.

    I have a form frmOutreachRefe rral that is filled in after a Site Visit has been performed and it is determined that the site needs a follow up visit.

    A Site Visit is entered into frmSV and is based on tblOutreachAdmi n with its primary key (autonumber) field called OutreachID. If a referral is needed, you click on a...
    See more | Go to post

  • ADezii,
    This works beautifully! and solves my problem
    Thank you so much for the help.

    Banderson...
    See more | Go to post

    Leave a comment:


  • problem with concatenating fields in the same column from multiple rows

    Hello all,
    I have a table "tblContact s" that holds my Contact Info. Because there can be multiple Contact Types for a Contact, I have a second table "tlnkContactTyp es" in which there is a record for every Contact / Type combination.

    tblContacts: ContactID, NmFirst, NmLast. etc...

    tlnkContactType s: ContactID, ContactType (which is selected from value list)

    For a summary query...
    See more | Go to post

  • Hello all,
    After reading what the SmileyOne said, I also discovered the "And" option - as a way around the nesting of ELSEIF statements. And, as you have all pointed out, it works!

    So, note to anyone "listening in", you can implement control validation that requires the code to look for two conditions to be satisfied by using "And" along with IF....ELSE...EL SEIF (or CASE...CASE ELSE) logic.
    ...
    See more | Go to post

    Leave a comment:


  • Hello NeoPa, SmileyOne and Nic;o)

    I am intrigued with Nic;o) 's code that puts all control validation errors into one message. However, before looking more into that I wanted to try to see if I could debug the existing code. After reading the two suggested debugging articles, I put in some break points and walked through the code step by step. (As an aside, even with my novice understanding of the debugging, I found it a very helpful...
    See more | Go to post

    Leave a comment:


  • form control validation in close button VBA

    Thank you NeoPa and TheSmileyOne.
    I will take a look at your suggestions and also take a look at the debugging article. Will post back with a solution or if I have additional problems.

    Thanks again!
    Banderson
    See more | Go to post

    Leave a comment:


  • banderson
    started a topic form control validation in close button VBA

    form control validation in close button VBA

    Hello,
    I have a form with a button "Done" that closes the form on the command Do.Cmd Close.
    Before I close the form, I would like to check that required fields have been entered. Not all of these fields can be required through the table because some are only conditionally required. In other words, depending on the value in one field, different fields are required.

    I have used a series of IF... ELSE IF.... statements....
    See more | Go to post
    Last edited by NeoPa; Jan 30 '10, 12:06 PM. Reason: Indented code properly to see what is going on where

  • Thanks, NeoPa.
    Unfortunately using "Call" didn't work either... I have ended up doing a Requery of the whole form. Then because the whole form Requery results in the form jumping to the first record, I have added a bookmark to return to the record that was being edited. It is frustrating that it cannot be more straightforward , but this works, so I'm going with it!

    Here is my code to Requery subforms from the AfterUpdate...
    See more | Go to post

    Leave a comment:


  • Thanks for asking.
    My subform and the name of the subform control are both "sfrmAddr1" . Is it problematic to name the subform control the same as the subform itself?

    I am making some progress in understanding requerying, but this issue is still a mystery: how to call a requery of a subform from the AfterUpdate_Eve nt of a control in the main form.

    If I requery a subform from the subform itself (using...
    See more | Go to post

    Leave a comment:


  • Thanks, NeoPa.
    Sigh. I just think I'm getting the hang of Access/vba and then realize how much I don't really get...
    Thanks again
    Bridget
    See more | Go to post

    Leave a comment:


  • Thanks, NeoPa. Sorry for all the details before, I was trying to be thorough, but maybe it was too much...

    I have looked at the "referring to items on a sub-form" and other postings about properly referencing subforms. Using these, I have tried many iterations of the requery code without success. I would like to requery the entire subform, and so my understanding is that I want to reference the form as a control of the main...
    See more | Go to post

    Leave a comment:


  • Thank you NeoPa and Stewart for your responses. I think this may reveal a flaw in my understanding of how forms can /should connect. Let me give a specific example and see if that helps to shed some more light on it.

    I have two forms “frmAddSites” and “sfrmAddr1” that are linked in a form/subform relationship:

    “frmAddSites” has a control source, tblSites.
    The table, tblSites, includes:
    SiteID – primary key, autonumber
    ...
    See more | Go to post

    Leave a comment:


  • banderson
    started a topic inconsistent behavior of form / subform link

    inconsistent behavior of form / subform link

    Hello all,
    I am hoping that you can help me with a problem that has occurred numerous times on various forms in the two databases that I am working on. When I first add a subform to a form linking child and master fields (primary key and foreign key), the subform will automatically update when the master field on the main form is changed (it is in a combo box). However, when I work more on the form - making it a bit more complicated, adding...
    See more | Go to post

  • Hello ADezii,
    Thank you for your response. I tried basing the query on the table and still got the error Undefined Function "" in Expression. After looking at a number of manuals & listserves, I figured out that the problem was not in the query, but rather that I had named the Module the same name as the function fConcatString! Apparently the module and function w/in the module cannot have the same name. After changing the module...
    See more | Go to post

    Leave a comment:


  • Well, I tried the code and seem to be having a problem getting the query to read the function. When I click on the combo box drop down I get the error message:
    "Undefined function ‘fConcatString’ in expression."

    I have to admit this is my first time using a pubic function, so it is possible I am doing something wrong, though after reading a few online tutorials on creating public functions, I cannot seem to figure...
    See more | Go to post

    Leave a comment:


  • Hi Linq and ADezii - So glad I'm not the only one tearing my hair out with these multiple Iif statements! Great suggestion on the ampersand and thanks so much for the code with the function call! I will get to work trying it out and post back with problems and the final solution.
    Bridget...
    See more | Go to post

    Leave a comment:


  • conditional syntax for a combo box displaying concatenated fields

    Hello,
    I have a combo box in which I want to display multiple fields by concatenating the fields together. If one of those concatenated fields is Null, then the combo box does not show anything. To rectify this I have created IIf statements to check if certain fields are Null and remove those fields from the concatenation. The problem I am having is how to check if multiple fields are Null. I think I need to use AND in my code, but cannot...
    See more | Go to post
No activity results to display
Show More
Working...