Avatar of lulubell-b
lulubell-b

asked on 

trouble populating combobox

Hello,

I'm trying to populate a combo box on a form load() and I've been having issue.

Initialy I have a form that is being populated on a record source from table tblExport. I'm trying to validate some columns on the form with the form load().

Is this possible? I have no idea what I'm doing wrong.

Thank you

Public Sub Form_Load()
      
Dim Day11 As String

Day11 = "W"
    
    If IsNull(Forms!frmCalendar!cbo11) = True Or Forms!frmCalendar!cbo11 = "" Then
                Me.cbo11 = Me.cbo11.Column(1)
       
        'End If
    Else
           
    End If
    
End Sub

Open in new window

Microsoft Access

Avatar of undefined
Last Comment
harfang
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image



Note quite sure what you are trying to do ... ?

Public Sub Form_Load()
     
      Dim Day11 As String

     Day11 = "W"
   
    If Nz(Forms!frmCalendar!cbo11 , "") = "" Then  Me.cbo11 = Me.cbo11.Column(1) ' ????????
       
 
End Sub
Avatar of lulubell-b
lulubell-b

ASKER

I'm grabbing the data from a table directly to populate the form, but I need to virtually populate the blank (or null) cells with a value.

GOAL: Populate the null cells without inserting into the table.

Is this possible or do I have to insert the values into the table in order to show the values on the form?

 
"Is this possible or do I have to insert the values into the table in order to show the values on the form?'

Well ... if ... your control(s) is *not* bound to a field in the table, then no ... you don't have to insert into the table.  But, if your control(s) is bound to a field in the table, then it will be 'inserted' into the table once the record is *saved*.

mx
Avatar of lulubell-b
lulubell-b

ASKER

How do I populate the field on the form when the value is null?
Avatar of lulubell-b
lulubell-b

ASKER

These are the properties for combobox cbo11

control Source 11
Row Source Type Table/Query
Bound Column 1
Show Only Row Source No
What is frmCalendar ?
Is that this form ?

Sorry ... I'm just not following what you are wanting to do ?

mx
Avatar of lulubell-b
lulubell-b

ASKER

Yes that is the form.

I have form called frmCalendar that is being populated using table Export. The form has fields called

TeNm   |  BaseNm  | 11
-----------------------------------
12345     ABC             W
55555     BDD             C
77778     XXX


11 is the combobox. When the form is loaded it grabs the values from the table and placed it into the objects on the form.

I need to populate a value where 11 is blank just on the screen. I thought I could perform that using the FORM_LOAD() event.

Does that clarify any>
Avatar of lulubell-b
lulubell-b

ASKER

?????? Does that make sense?????
ASKER CERTIFIED SOLUTION
Avatar of harfang
harfang
Flag of Switzerland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo