Refresh Combo after load - what syntax (1 Viewer)

mik

Lost in a VBA Jungle
Local time
Today, 16:41
Joined
Nov 16, 2004
Messages
22
Hi, I have a form that uses an unbounded combo to display a summary of what is loaded. It runs a simple sql query to produce the summary.

A separate button on the same form runs a vb script that loads to the table.

What syntax should be added to then end of the load vb script to update the combo?
 

llkhoutx

Registered User.
Local time
Today, 01:41
Joined
Feb 26, 2001
Messages
4,018
Set the combobox rowsource:

Me!cboName.RowSource = "Select 'whatever

Be sure that all combobox properties have appropriate values, esp. Column Count, Column Width, Row Source Type, etc.
 

mik

Lost in a VBA Jungle
Local time
Today, 16:41
Joined
Nov 16, 2004
Messages
22
Thanks llkhoutx,

I'm nearly there, can you help with the following error message

The record source 'Me!Files_Already_Loaded.RowSource = "Select......' specified on this form or report does not exist

( :confused: How do you upload pictures?)
 
Last edited:

reclusivemonkey

Registered User.
Local time
Today, 07:41
Joined
Oct 5, 2004
Messages
749
What about Me.ComboList.Refresh? or is it .Requery? I can never remember! One of them should work.
 

llkhoutx

Registered User.
Local time
Today, 01:41
Joined
Feb 26, 2001
Messages
4,018
You jpg doesn't display and you didn't specify the complete SQL. Please clarily.
 

mik

Lost in a VBA Jungle
Local time
Today, 16:41
Joined
Nov 16, 2004
Messages
22
Hi llkhoutx,

The SQL was the origional SQL that populated the combo box, it was a simple aggregrate query, something like (Have actual code at work)

Select FileName
from Summary_Query
order by Load_Date Descending

And Summary_Query is somthing like

Select Sum(SMS_Quantity), FileName, Load_Date
from Summary_Table
Group by FileName, Load_Date
Order by Load_Date descending

Picuture was a screen dump of the error. Sorry don't know how to upload the pictures.

reclusivemonkey, Do I put the line Me.ComboList(.Refresh? or is it .Requery) at the end of my load script? Do I replace ComboList with the name of the unbounded combo box - (Me.Files_Already_Loaded.Refresh or Me.Files_Already_Loaded.Requery).
 

mik

Lost in a VBA Jungle
Local time
Today, 16:41
Joined
Nov 16, 2004
Messages
22
Got the combo to requery

Thanks Guys, the combo now refreshs.

Solution was to add Me.Files_Already_Loaded.Requery (where Files_Already_Loaded is the name of the combo box) to the end of the load script.
 

Users who are viewing this thread

Top Bottom