General discussion

Locked

Access - form refresh

By mrmolio ·
I have a tabbed form, 3 tabs, each corresponding to a different table. The controls on each tab are the same (the structure of the underlying tables are identical).

I have the tab control's Change event triggering a change in the Record Source property of the Form, but I'm missing something.

As I change from one tab to another, it seems to change the record source of the form, but not all controls update. I tried adding a Requery to the individual controls, but it doesn't change. The mainone's I'm having a problem with are combo boxes. They don't seem to refresh themselves.

Any help? My code is below:

Dim tbc As Control, pge As Page
Dim ctl As Control
Dim strSource As String

Set tbc = Me!TabCtl0
Set pge = tbc.Pages(tbc.Value)
If tbc = 0 Then
strSource = "tblLiquids"
ElseIf tbc = 1 Then
strSource = "tblSolids"
ElseIf tbc = 2 Then
strSource = "tblTopicals"
End If

Forms!EntryForm.RecordSource = "SELECT * FROM " & strSource
Forms!EntryForm.Refresh

thanks,

Craig

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Access - form refresh

by DSR28 In reply to Access - form refresh

I think that I had to try combo.requery to get the combobox to re-list the data. For some reason, individual controls are refreshed (as far as relating to combobox values) but the underlying data does not get reloaded. Painful, but it worked for me.

Collapse -

Access - form refresh

by mrmolio In reply to Access - form refresh

Poster rated this answer

Collapse -

Access - form refresh

by donq In reply to Access - form refresh

You are making a simple task difficult.

Create ONE query to populate every field on your form. (and test it to insure you have a Dynaset that lets you change data in ANY field)

The fields going on tab A MUST come from Table A (no foreign keys from a related table)

The fields going on tab B MUST come from Table B (no foreign keys from a related table)

The fields going on tab C MUST come from Table C (no foreign keys from a related table)

Base all Form objects code on all or part of this query and place the SQL code (just like you did in your sample) within the appropriate objects to insure everything is synchronized AND everything automatically updates any time any value updates.

Hope this helps. Don Quigg

Collapse -

Access - form refresh

by mrmolio In reply to Access - form refresh

Poster rated this answer

Collapse -

Access - form refresh

by mrmolio In reply to Access - form refresh

This question was closed by the author

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums