When I add name of a new individual in a, form, it will not display in a second.

jphelan

Registered User.
Local time
Today, 04:56
Joined
Oct 30, 2005
Messages
15
When I add the name of a new individual in a, bound form, it will not display that person’s name in a label control of a second unbound form.

I have a scheduling program that I am working on. Included in the application program is a data “GRID” which I believe was created using Visual Basic, not standard Access. Its purpose is to display the results of a range of “from-to-dates” of registrations for different clients. The difficulty that I am having is in displaying new registrant names in a display label of a second form when it’s GRID is immediately accessed via a command button after a registration is completed. The display label works just fine for existing entries that came with the data GRID module that I previously purchased. It’s just when I try to add NEW entries that the label control will not work/refresh. However, other than the names of new entries not appearing in the label control, the range of start to end-date for these entries, created in the first form, does display in the GRID of the second form as it should.

The following is a description of how everything is supposed to work:

I have three forms; two with tables and one (unbound) display form with a data Grid that graphically start to end-date in a bar graphic:

1. Form: frmGuest (label name: fsubGuest)
Table: tblGuest
Field: GuestID (label name: cboGuestID) which holds the registered name

This form is used to create individual records/accounts for future registrations and the
listing of past Registrations.


2. Form: frmStatus
Table: tblstatus

Form is used to create registration schedules for individuals pulled from the above form, “frmGuest” and table, “tblGuest”. You normally would select a name from a combo box on this, “frmStatus”, form along with selecting the appropriate start and end-dates.

This form contains a command button for accessing the data Grid for viewing results of the date range for an appointment just created. .

When you press the command button, you are immediately taken to the scheduling data Grid (frmMain).

Whatever name you had selected before pressing the command button, above, should now appear in the, label control, “lblCurrStat” on the, “frmMain form below along with the graphically depicted corresponding date range in the Grid in the form of a bar graph.

3. Form: frmMain
Table: unbound

Form is used to graphically display the registrant’s start to end-date, just made from the form, “frmStatus”, in frmMain form and the data GRID.

The form, “frmMain” contains the label control, “lblCurrStat” that displays the name of an individual selected in the, “frmStatus” form along with a couple of other pieces of information corresponding with the bar graph.

Again, all the above will work, except ONLY WITH EXISTING registrations, but not new ones. When you add the name of a new individual in the form (along with a couple of pieces of information), “frmGuest” and table, “tblGuest” described above, it will not display that person’s name in the label control, “lblCurrStat” located on the, “frmMain” form. However, the date range for the registration does show up in the data GRID of the same form.

Here is a portion of the Module, "basGrid" that I use to reference the label control, "lblCurrStat" located on the, “frmMain” Grid form that is supposed to refresh the registrants name and other information:

With frmS

frmM!lblCurrStat.Caption = !cboGuestID.Column(1) & vbCrLf & _
!cboUnitID & vbCrLf & _
!cboStatusType.Column(1)
End With
ExitLine:
Exit Sub
End Sub

To show that it “should” work; all I have to do is change the “Column(1)” number. The information in the, “lblCurrStat”label control on the, “frmMain” form will change as a result, but only on old entries.

John
 

Attachments

Last edited:
Wow! That's a pretty neat db:)

I entered Me.Refresh in frmGuest.txtLName's AfterUpdate event.

I entered me, m1 as a new guest and it seems to work w/ the other forms, but I'm sure you want to dig through it yourself as you are more intimate with the ins and outs of your db.

Hope this helps.
 

Attachments

I continue to get the same problem. Take a look at the, "frmMain" and the portion of the form that contains the GRID.

In the upper right side of the form; you will see, a "lable" titled, "Selected Unit Status Record".

Just below that, you will see a display control area that has, "lblCurrStat" under "Properties"/"Name". This control is located just right of a lable with the titles, "Guest"", Link:", and "Type:" inside.

In the "frmStatus" form, you select a person's name in the, "GuestID" combo box field, dates in the, "Arrival Date", and "Departure Date" fields, and finally, a "Unit Number" in the "UnitID" combox field, labled, "Unit Number" (required). You then select the GRID button. When you click on the GRID, "cmdGridSync", command button with a blue triagle; it is supposed to flip you over to the, frmMain form and the GRID area.

The "Arrival Date" and Departure Date range graphically display as it should.
However, the, display control, ""lblCurrStat" does not refresh with the new name you entered along with the dates you entered in the, "frmStatus" form.

Does this help?

John
 
I probably won't be able to check it out today. Give me a bit and I'll get back to you, whether I find something or not. Don't wanna leave ya hangin'.:cool:
 
Da-a; Nothing like looking for the forest than looking thru the trees.

It turns out that your solution was correct; just mis-placed. Instead, I placed the, "meRefresh" statement in the "OnClick" of the display control, "“lblCurrStat”. I only used such statements in bound fields. I never thought of being able to use them in a display/lable field.

Thanks for "Refresh"ing me brain.

John:o
 
I tried it, but couldn't get it to work.

I also can't seem to find out where to fix this thing, either. Sorry.
 
What you do is; open the "frmMain" form; click on the "lblCurrStat: control; open up the "Properties" and "Event" tab. Click on the "On Click" and create the, "me.refresh" in the "Event Procedure".

This works; give it a try.

John
 
I did that, but it's still not updating the info for new entries.

I can't even find the specific code that tells that label what to show. There's a lot of public functions in modules and even more code in each form, but I can't find exactly where it gets its info from. I found something that looked like it might be it. I tried various bits and pieces in there, but nothing worked.

This one's a "little" beyond my grasp.
 
Well, guess what. It did work when I added two new records as a result of putting in the me.refresh statement. I just added a third record, and even though the previous two new record continue to show, guess what? The newest record DOES NOT SHOW. I just don't get it.

John
 
Here is a portion of the Module, "basGrid" that contains the reference to the lable control, "lblCurrStat":


Public Sub PlaceManagerNotes()
Dim frmS As Form, frmM As Form
Dim rs As DAO.Recordset, sql As String
Dim sTemp As String, vNote As Variant

Set frmM = Forms!frmMain
Set frmS = frmM!fsubStatus.Form
sql = "SELECT Request FROM tblStatusReq WHERE StatusID = " & frmS!txtStatusID
Set rs = CurrentDb.OpenRecordset(sql)

With rs
If Not (.BOF And .EOF) Then
.MoveFirst
Do Until .EOF
vNote = DLookup("ManagerNotes", "trefRequest", "Request = '" & !Request & "'")
If Not IsNull(vNote) Then
If sTemp <> "" Then
sTemp = sTemp & vbCrLf & vbCrLf & !Request & " - " & vNote
Else
sTemp = !Request & " - " & vNote
End If
End If
rs.MoveNext
Loop
frmS!lblManagerNotes.Caption = sTemp
Else
frmS!lblManagerNotes.Caption = " "
End If
End With

With frmS

‘HERE IS THE REFERRENCE TO, “lblCurrStat” IN THE MODULE, “basGRID”

frmM!lblCurrStat.Caption = !cboGuestID.Column(1) & vbCrLf & _
!cboUnitID & vbCrLf & _
!cboStatusType.Column(1)
End With
ExitLine:
Exit Sub
End Sub
 

Users who are viewing this thread

Back
Top Bottom