Solved

Update a table

Posted on 2011-03-16
2
184 Views
Last Modified: 2012-05-11
Experts,

I have a form frmLetterOfCredit_Cont that is built off of tblLetterOfCredit.
I also have a form frmLetterOfCreditAdd built off of tblLetterOfCredit.
What I need to do is update [region] that is contained on frmLetterOfCreditAdd without having to actually go to this form.  
[Region] is a combo box.

While on frmLetterOfCredit_Cont I enter in the "Country" from cboCountry on this frmLetterOfCredit_Cont and after I update this I want to be able to update this field named cboRegion [Region] on frmLetterOfCreditAdd

both forms are built off of tblLetterOfCredit.  

The reason I want to update cboRegion instead of actually going to the form is becuase the network is a little slow and I do not want to transfer this field to frmLetterOfCredit_Cont but let it remain on frmLetterOfCreditAdd.  

cboRegion on frmLetterOfCreditAdd rowsource:
SELECT tblRegion.ID, tblRegion.Region FROM tblRegion ORDER BY tblRegion.Region;

I guess I would need an unbound form with cboRegion on it and then once I select one of the options from the dropdown box then the [Region] field on tblLetterOfCredit would update with what I selected from this unbound field on a form called say frmRegionPopUp.

Maybe there is a much simpler way to do this.  I am open to suggestions of how I could update the value on the combo [Region]  under tblLetterOfCredit while on frmLetterOfCredit_Cont without having to actually go to that frmLetterOfCreditAdd where [Region] resides.  Keep in mind that the both forms contain tblLetterOfCredit and I could get a WriteConflict error.  

LetterOfCreditID is the link between the forms frmLetterOfCredit_Cont and frmLetterOfCreditAdd.

thank you.  Please ask questions if not clear.

I attempted to do this myself with an AfterUpdate on cboCountry but did encounter a write conflict error (but now I believe an UNBOUND form would be better than a bound form which is what the frmRegionPopUp was built off of (tblLetterOfCredit).

Private Sub cboCountry_AfterUpdate()

     If IsNull(Me.cboRegion) Then
        MsgBox "Enter the Region of Export on the LC Detail form (click LC No)", vbInformation
    '    DoCmd.OpenForm "frmRegionPopUp", , , "[LetterOfCreditID]=" & Me.ID, , acDialog
    'Me.Refresh ' have an issue with write conflict...removed docmd. 3/15/11 have tried refresh, requery, dirty...posted EE.
   
    End If
   
End Sub



Hope it makes sense.  Let me know if you have any ideas.  

0
Comment
Question by:pdvsa
2 Comments
 

Author Comment

by:pdvsa
ID: 35147607
There are a lot of words there.  Just a summary:  I want to update tblLetterOfCredit [Region] without having to go to the frmLetterOfCreditAdd.  I want to do this while on frmLetterOfcredit_Cont.  

I guess I could drag [Region] on the frmLetterOfCredit_Cont and hide it then make it visible but it would look a little funny becaus I have no space for [Region] on frmLetterOfCredit_Cont.
0
 
LVL 39

Accepted Solution

by:
als315 earned 500 total points
ID: 35154233
If control is not visible, you can put it behind any other control. It will be not easy to edit (you can use Tab to move between controls).
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now