0

Good Day all. I have a quick question. I have an openargs value that I'm am trying to use to show up in my combobox (cmbMemberName) on return from another form. The combobox populate the underlining subform. I just can't seem to get the right method. I can't use recordsource cause that would filter out the rest of the records. Rem: I just want the focus on the updated record and loaded into the combobox upon return. Here's the last method I tried.

If Nz(Me.OpenArgs) <> 0 Then

    Me.cmbMemberName.SetFocus
    DoCmd.FindRecord Me.OpenArgs

    MsgBox (Me.OpenArgs)
    Me!cmbMemberName.Dropdown

Else
   ....

The error occurs on the DoCmd. Any suggestions. Thanks. I could load the entire sequence, but don't think that would be necessary.

Engineer
  • 32
  • 5
JZeig1
  • 403
  • 1
  • 6
  • 13
  • Oh, the title of this post might be a little misleading. I was having problem with the limit-to-list function, but I think I've found a resolution to that. But was wondering how to keep the default action from happening altogether and strictly use the code that I've entered. – JZeig1 May 17 '18 at 13:11
  • Confused - you can edit your question and change the title to fit properly. In any case can't you just set `cmbMemberName.Value = me.OpenArgs` – dbmitch May 17 '18 at 14:09
  • Me a dummy. Thanks much... – JZeig1 May 17 '18 at 15:59
  • No problem - happy coding – dbmitch May 17 '18 at 16:02

1 Answers1

0

First you have to set the value of the combo box. Assuming your openargs matches the bound column of the combo box that should simply be

Me.cmbMemberName = Me.OpenArgs

After that you need to get you subform to populate based on the combo box value. Assuming you have set the subform to properly read the value you just need to requery it

Me.MySubForm.requery
SunKnight0
  • 3,331
  • 1
  • 10
  • 8
  • I used the both options - the one from dbmitch and yours. They both work. Thanks. I got the hard stuff to work. Need to get a little more familiar with the properties and methods of the objects. :-) – JZeig1 May 17 '18 at 16:02