By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,496 Members | 1,489 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,496 IT Pros & Developers. It's quick & easy.

updating two fields from a combo box?!

P: 1
i know i should not be asking..... but i am!
ok, i am trying to make a simple database (real Simple) it will store publications, just the volume and issue numbers and also their print cycle (ie. monthly, weekly.....) all i am trying to do is make a form that when an individual opens the form to enter a publication all they need to do is select the publication from a combobox and its print cycle is automgicaly updated. i am very NEW, like still shiny and squeeky new. i tried this code but it did not work... i think i am getting stuck in the making of the tables?!!

Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo0_Change()
  2. With Me(Publication)
  3. If IsNull(Me!Publication) Then
  4.     .RowSource = ""
  5.     Else
  6.         .RowSource = "SELECT [PrintCycle] " & _
  7.                      "FROM TblPrintCycle " & _
  8.                      "WHERE [PrintCycle]=" & Me!Publication
  9.     End If
  10.     Call .Requery
  11. End With
  12.  
  13. End Sub
Mar 28 '07 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
If PrintCycle is a text field the following should work.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo0_Change()
  2. With Me(Publication)
  3. If IsNull(Me!Publication) Then
  4.     .RowSource = ""
  5.     Else
  6.         .RowSource = "SELECT [PrintCycle] " & _
  7.                      "FROM TblPrintCycle " & _
  8.                      "WHERE [PrintCycle]='" & Me!Publication & "'"
  9.     End If
  10.     Call .Requery
  11. End With
  12.  
  13. End Sub
Mary
Mar 28 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.