Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2014
    Location
    Pittsburgh, USA
    Posts
    28

    Unanswered: Problem with Form_Current and Control Source Value

    Hi Guys,

    I have a problem and cannot for the life of me figure out what's wrong. I know the below seems complicated but it's really a simple database...

    The whole concept of the DB I'm creating is to allow the Sales Offices in our company to request Proposals from the Business Unit. They can only enter technical data for a proposal once so if they make changes they have to create new revisions. Hence, I have 2 tables: Proposals which has the client, location, status of proposal (whether submitted or not), date submitted, date requested, etc... And Revisions which has the technical data.

    Then I would like to allow the people in the business unit to take a look at these proposals, change the status to submitted (and the submitdate is updated accordingly). They will have a password to access a special form enabling them to change the status as opposed to the sales offices who can only access a form that does not allow them to touch the status button.

    However, a Sales Office might create a new revision on a proposal that has already been submitted. In this case, I would like the Status to go back to being NOT SUBMITTED and the submitdate to become blank.

    In order to do that, I have created 2 fields for the proposal. One is called CounterP, and its control source is a counter field in its Subform (which lists all the revisions under the Proposal). The other is called SubmitFlag, which changes to CounterP once the Person in the Business Unit changes the status to SUBMITTED.

    However, once I open the Sales Office form to request a new revision, in Form_Current, I have the below code:

    If Me.CounterP.Value <> Me.SubmitFlag.Value Then
    Me.Status.Value = "Not Submitted"
    Me.DateSubmitted.Value = ""
    End If

    CounterP does not seem to return a value because every time I open this form, the status changes to NOT SUBMITTED even though CounterP = SubmitFlag. I can see it in the textbox which has a Control Source as the SubForm counter: =IIf(IsNumeric([HFRevisionTSubform].[Form]![txtcount]);[HFRevisionTSubform].[Form]![txtcount];0)
    but when I tried to make a TextBox return the value of CounterP, I always got a blank..

    Why is CounterP returning a blank value to a variable or a textbox, but staying correct in its own textbox with the Control Source?

    And in which Private Sub should I execute this code?

    If Me.CounterP.Value <> Me.SubmitFlag.Value Then
    Me.Status.Value = "Not Submitted"
    Me.DateSubmitted.Value = ""
    End If

    I know this seems complicated, but ANY advice will be reaaaaalllllly appreciated!!

    Thanks!

    Desperate Randa

  2. #2
    Join Date
    Feb 2014
    Location
    Pittsburgh, USA
    Posts
    28
    Ok, forget about it.. I found the solution. I just didn't use Control Source anymore. It just messed things up. Coding is the way to go.

    Cheers!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •