Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access refresh from

Status
Not open for further replies.
Nov 16, 2006
19
0
0
GB

Code:
Private Sub dd_Name_Change()

    Dim strSQL As String

    strSQL = "UPDATE tblVar SET [AgentID]=" & Form_frm_EditAgent.dd_Name.Value & ";"
    
    DoCmd.RunSQL strSQL
    
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

End Sub

What the above should be doing is when the dropdown changes sending its value to the variable table.

The form should then refresh, thus refreshing the data in the subform which is linked to a query based on the value updated in the variable field.
 
Ah, i should mention is that when it sends the data to the form it works fine, but on the refresh code:
Code:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

it says "Refresh not available" in an error message.

If i wait for about 30 seconds the data updates on its own but i need it to be almost instant.
 
Ah thank you very much.

After that i need to select elements in the query like:

Form_frm_EditAgent.sfrm_AgentDetails.Field1 but when i type this in, nothing comes up on command menus like usual.

How can i access them?
 

Hmmmmm
Field1 is a textbox?

Forms![Form_frm_EditAgent]![sfrm_AgentDetails].[Field1]
 
sfrm_AgentDetails shows results from a query

Field1 would be one of the fields from that query
 
MsgBox (Forms![frm_EditAgent]![sfrm_AgentDetails].[TM_ID])

=

"Object doesn't support this property or method
 
So, the question is a bit vague
i need to select elements in the query
 
Dim strMonkey

strMonkey = sfrm_AgentDetails.Form!Aspect_No


Worked fine.

Sorry for not explaining myself adequately :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top