Restrictive ComboBox

U

Utopian®

Hello RuralGuy, thanks for reply!

I dont undertand where I have to put your code .... in the after update event I have this:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"
End Sub

Thanks!

Adrian.-


--------------------------------------------------------------------------------




I believe I understand your question. Pass the *where* clause as absolute
information rather than a reference to your form that must now remain open for
the query of the next form.

DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then close your form
DoCmd.Close acForm, Me.Name, acSaveNo

Hello everybody!

I need this precise:

I have 2 Forms, one "initial" and another "Secondary 2"..... In the "initial" there is a ComboBOX (with the code above) in which I choose a "City"... this does that it loaded the "Secondary 2" form just by the data pertaining to the chosen city.


--------------------------------------------------------------------------------

Private Sub choose_AfterUpdate()

DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"

End Sub

--------------------------------------------------------------------------------


Now, which I need is: That when choosing this city once, no longer is possibility of returning to choose another one in the next load.

I hope to have been clear, and sorry for my english!!!

Thanks in advance,

Adrian.-

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
U

Utopian®

Helppp!!! the code dont work! :-(

I choose a value in the combobox and nothing happens .......

for your information, idCity is in another table, not in the one of Cities, reason why the RowSource that I have in combobox is

SELECT dbo_City.id, dbo_City.Description FROM dbo_City ORDER BY [Description]; .......................it has some relation with the problem?

I hope you can help me!!!

Adrian.-

--------------------------------------------------------------------------------



Hi Adrian,

The AfterUpdate event of the ComboBox should work:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then just close your form
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub

Hello RuralGuy, thanks for reply!

I dont undertand where I have to put your code .... in the after update event I have this:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"
End Sub

Thanks!

Adrian.-


--------------------------------------------------------------------------------




I believe I understand your question. Pass the *where* clause as absolute
information rather than a reference to your form that must now remain open for
the query of the next form.

DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then close your form
DoCmd.Close acForm, Me.Name, acSaveNo


Hello everybody!

I need this precise:

I have 2 Forms, one "initial" and another "Secondary 2"..... In the "initial" there is a ComboBOX (with the code above) in which I choose a "City"... this does that it loaded the "Secondary 2" form just by the data pertaining to the chosen city.


--------------------------------------------------------------------------------

Private Sub choose_AfterUpdate()

DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"

End Sub

--------------------------------------------------------------------------------


Now, which I need is: That when choosing this city once, no longer is possibility of returning to choose another one in the next load.

I hope to have been clear, and sorry for my english!!!

Thanks in advance,

Adrian.-

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
U

Utopian®

No way ...... :-(


--------------------------------------------------------------------------------


Let's try [idCity] as numeric:

DoCmd.OpenForm "Secondary 2", , , "[idCity]=" & Me.choose


Helppp!!! the code dont work! :-(

I choose a value in the combobox and nothing happens .......

for your information, idCity is in another table, not in the one of Cities, reason why the RowSource that I have in combobox is

SELECT dbo_City.id, dbo_City.Description FROM dbo_City ORDER BY [Description]; .......................it has some relation with the problem?

I hope you can help me!!!

Adrian.-

--------------------------------------------------------------------------------



Hi Adrian,

The AfterUpdate event of the ComboBox should work:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then just close your form
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub


Hello RuralGuy, thanks for reply!

I dont undertand where I have to put your code .... in the after update event I have this:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"
End Sub

Thanks!

Adrian.-


--------------------------------------------------------------------------------




<RuralGuy> escribió en el mensaje I believe I understand your question. Pass the *where* clause as absolute
information rather than a reference to your form that must now remain open for
the query of the next form.

DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then close your form
DoCmd.Close acForm, Me.Name, acSaveNo


Hello everybody!

I need this precise:

I have 2 Forms, one "initial" and another "Secondary 2"..... In the "initial" there is a ComboBOX (with the code above) in which I choose a "City"... this does that it loaded the "Secondary 2" form just by the data pertaining to the chosen city.


--------------------------------------------------------------------------------

Private Sub choose_AfterUpdate()

DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"

End Sub

--------------------------------------------------------------------------------


Now, which I need is: That when choosing this city once, no longer is possibility of returning to choose another one in the next load.

I hope to have been clear, and sorry for my english!!!

Thanks in advance,

Adrian.-

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
A

Adrian

Hello everybody!

I need this precise:

I have 2 Forms, one "initial" and another "Secondary 2"..... In the "initial" there is a ComboBOX (with the code above) in which I choose a "City"... this does that it loaded the "Secondary 2" form just by the data pertaining to the chosen city.


--------------------------------------------------------------------------------

Private Sub choose_AfterUpdate()

DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"

End Sub

--------------------------------------------------------------------------------


Now, which I need is: That when choosing this city once, no longer is possibility of returning to choose another one in the next load.

I hope to have been clear, and sorry for my english!!!

Thanks in advance,

Adrian.-
 
R

RuralGuy

I believe I understand your question. Pass the *where* clause as absolute
information rather than a reference to your form that must now remain open for
the query of the next form.

DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then close your form
DoCmd.Close acForm, Me.Name, acSaveNo

Hello everybody!

I need this precise:

I have 2 Forms, one "initial" and another "Secondary 2"..... In the "initial" there is a ComboBOX (with the code above) in which I choose a "City"... this does that it loaded the "Secondary 2" form just by the data pertaining to the chosen city.


--------------------------------------------------------------------------------

Private Sub choose_AfterUpdate()

DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"

End Sub

--------------------------------------------------------------------------------


Now, which I need is: That when choosing this city once, no longer is possibility of returning to choose another one in the next load.

I hope to have been clear, and sorry for my english!!!

Thanks in advance,

Adrian.-

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
R

RuralGuy

Hi Adrian,

The AfterUpdate event of the ComboBox should work:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then just close your form
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub

Hello RuralGuy, thanks for reply!

I dont undertand where I have to put your code .... in the after update event I have this:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"
End Sub

Thanks!

Adrian.-


--------------------------------------------------------------------------------




I believe I understand your question. Pass the *where* clause as absolute
information rather than a reference to your form that must now remain open for
the query of the next form.

DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then close your form
DoCmd.Close acForm, Me.Name, acSaveNo

Hello everybody!

I need this precise:

I have 2 Forms, one "initial" and another "Secondary 2"..... In the "initial" there is a ComboBOX (with the code above) in which I choose a "City"... this does that it loaded the "Secondary 2" form just by the data pertaining to the chosen city.


--------------------------------------------------------------------------------

Private Sub choose_AfterUpdate()

DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"

End Sub

--------------------------------------------------------------------------------


Now, which I need is: That when choosing this city once, no longer is possibility of returning to choose another one in the next load.

I hope to have been clear, and sorry for my english!!!

Thanks in advance,

Adrian.-

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
U

Utopian®

Hello RuralGuy!

I reply in the text below


I take it the "Secondary 2" form opens and this one closes but the selection
criteria does not work?
both things do not work. Form INITIAL opens, but when I choose something in the Combobox nothing happens!!!!!!
You are getting too many records or something?
The original code:
DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"
worked didn't it? yes, it works perfectly

Is [idCity] a Text field?
No, Is Numeric
Try:
DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose.Column(0) & "'"

This latest code doesn´t work!!!!

Thanks in advance!!

--------------------------------------------------------------------------------

No way ...... :-(


--------------------------------------------------------------------------------


Let's try [idCity] as numeric:

DoCmd.OpenForm "Secondary 2", , , "[idCity]=" & Me.choose



Helppp!!! the code dont work! :-(

I choose a value in the combobox and nothing happens .......

for your information, idCity is in another table, not in the one of Cities, reason why the RowSource that I have in combobox is

SELECT dbo_City.id, dbo_City.Description FROM dbo_City ORDER BY [Description]; .......................it has some relation with the problem?

I hope you can help me!!!

Adrian.-

--------------------------------------------------------------------------------



<RuralGuy> escribió en el mensaje Hi Adrian,

The AfterUpdate event of the ComboBox should work:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then just close your form
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub


Hello RuralGuy, thanks for reply!

I dont undertand where I have to put your code .... in the after update event I have this:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"
End Sub

Thanks!

Adrian.-


--------------------------------------------------------------------------------




<RuralGuy> escribió en el mensaje I believe I understand your question. Pass the *where* clause as absolute
information rather than a reference to your form that must now remain open for
the query of the next form.

DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then close your form
DoCmd.Close acForm, Me.Name, acSaveNo


Hello everybody!

I need this precise:

I have 2 Forms, one "initial" and another "Secondary 2"..... In the "initial" there is a ComboBOX (with the code above) in which I choose a "City"... this does that it loaded the "Secondary 2" form just by the data pertaining to the chosen city.


--------------------------------------------------------------------------------

Private Sub choose_AfterUpdate()

DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"

End Sub

--------------------------------------------------------------------------------


Now, which I need is: That when choosing this city once, no longer is possibility of returning to choose another one in the next load.

I hope to have been clear, and sorry for my english!!!

Thanks in advance,

Adrian.-

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
U

Utopian®

Hi again!! Can I send you, my MDB for inspect???


--------------------------------------------------------------------------------

I take it the "Secondary 2" form opens and this one closes but the selection
criteria does not work? You are getting too many records or something?

The original code:
DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"
worked didn't it?

Is [idCity] a Text field? Try:
DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose.Column(0) & "'"

No way ...... :-(


--------------------------------------------------------------------------------


Let's try [idCity] as numeric:

DoCmd.OpenForm "Secondary 2", , , "[idCity]=" & Me.choose



Helppp!!! the code dont work! :-(

I choose a value in the combobox and nothing happens .......

for your information, idCity is in another table, not in the one of Cities, reason why the RowSource that I have in combobox is

SELECT dbo_City.id, dbo_City.Description FROM dbo_City ORDER BY [Description]; .......................it has some relation with the problem?

I hope you can help me!!!

Adrian.-

--------------------------------------------------------------------------------



<RuralGuy> escribió en el mensaje Hi Adrian,

The AfterUpdate event of the ComboBox should work:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then just close your form
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub


Hello RuralGuy, thanks for reply!

I dont undertand where I have to put your code .... in the after update event I have this:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"
End Sub

Thanks!

Adrian.-


--------------------------------------------------------------------------------




<RuralGuy> escribió en el mensaje I believe I understand your question. Pass the *where* clause as absolute
information rather than a reference to your form that must now remain open for
the query of the next form.

DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then close your form
DoCmd.Close acForm, Me.Name, acSaveNo


Hello everybody!

I need this precise:

I have 2 Forms, one "initial" and another "Secondary 2"..... In the "initial" there is a ComboBOX (with the code above) in which I choose a "City"... this does that it loaded the "Secondary 2" form just by the data pertaining to the chosen city.


--------------------------------------------------------------------------------

Private Sub choose_AfterUpdate()

DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"

End Sub

--------------------------------------------------------------------------------


Now, which I need is: That when choosing this city once, no longer is possibility of returning to choose another one in the next load.

I hope to have been clear, and sorry for my english!!!

Thanks in advance,

Adrian.-

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
R

RuralGuy

Let's try [idCity] as numeric:

DoCmd.OpenForm "Secondary 2", , , "[idCity]=" & Me.choose


Helppp!!! the code dont work! :-(

I choose a value in the combobox and nothing happens .......

for your information, idCity is in another table, not in the one of Cities, reason why the RowSource that I have in combobox is

SELECT dbo_City.id, dbo_City.Description FROM dbo_City ORDER BY [Description]; .......................it has some relation with the problem?

I hope you can help me!!!

Adrian.-

--------------------------------------------------------------------------------



Hi Adrian,

The AfterUpdate event of the ComboBox should work:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then just close your form
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub

Hello RuralGuy, thanks for reply!

I dont undertand where I have to put your code .... in the after update event I have this:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"
End Sub

Thanks!

Adrian.-


--------------------------------------------------------------------------------




<RuralGuy> escribió en el mensaje I believe I understand your question. Pass the *where* clause as absolute
information rather than a reference to your form that must now remain open for
the query of the next form.

DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then close your form
DoCmd.Close acForm, Me.Name, acSaveNo


Hello everybody!

I need this precise:

I have 2 Forms, one "initial" and another "Secondary 2"..... In the "initial" there is a ComboBOX (with the code above) in which I choose a "City"... this does that it loaded the "Secondary 2" form just by the data pertaining to the chosen city.


--------------------------------------------------------------------------------

Private Sub choose_AfterUpdate()

DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"

End Sub

--------------------------------------------------------------------------------


Now, which I need is: That when choosing this city once, no longer is possibility of returning to choose another one in the next load.

I hope to have been clear, and sorry for my english!!!

Thanks in advance,

Adrian.-

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
R

RuralGuy

I take it the "Secondary 2" form opens and this one closes but the selection
criteria does not work? You are getting too many records or something?

The original code:
DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"
worked didn't it?

Is [idCity] a Text field? Try:
DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose.Column(0) & "'"

No way ...... :-(


--------------------------------------------------------------------------------


Let's try [idCity] as numeric:

DoCmd.OpenForm "Secondary 2", , , "[idCity]=" & Me.choose


Helppp!!! the code dont work! :-(

I choose a value in the combobox and nothing happens .......

for your information, idCity is in another table, not in the one of Cities, reason why the RowSource that I have in combobox is

SELECT dbo_City.id, dbo_City.Description FROM dbo_City ORDER BY [Description]; .......................it has some relation with the problem?

I hope you can help me!!!

Adrian.-

--------------------------------------------------------------------------------



<RuralGuy> escribió en el mensaje Hi Adrian,

The AfterUpdate event of the ComboBox should work:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then just close your form
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub


Hello RuralGuy, thanks for reply!

I dont undertand where I have to put your code .... in the after update event I have this:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"
End Sub

Thanks!

Adrian.-


--------------------------------------------------------------------------------




<RuralGuy> escribió en el mensaje I believe I understand your question. Pass the *where* clause as absolute
information rather than a reference to your form that must now remain open for
the query of the next form.

DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then close your form
DoCmd.Close acForm, Me.Name, acSaveNo


Hello everybody!

I need this precise:

I have 2 Forms, one "initial" and another "Secondary 2"..... In the "initial" there is a ComboBOX (with the code above) in which I choose a "City"... this does that it loaded the "Secondary 2" form just by the data pertaining to the chosen city.


--------------------------------------------------------------------------------

Private Sub choose_AfterUpdate()

DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"

End Sub

--------------------------------------------------------------------------------


Now, which I need is: That when choosing this city once, no longer is possibility of returning to choose another one in the next load.

I hope to have been clear, and sorry for my english!!!

Thanks in advance,

Adrian.-

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
R

RuralGuy

Sure. Zip it up. Use Rural Guy at Wild Blue dot net without any spaces.

Hi again!! Can I send you, my MDB for inspect???


--------------------------------------------------------------------------------

I take it the "Secondary 2" form opens and this one closes but the selection
criteria does not work? You are getting too many records or something?

The original code:
DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"
worked didn't it?

Is [idCity] a Text field? Try:
DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose.Column(0) & "'"

No way ...... :-(


--------------------------------------------------------------------------------


<RuralGuy> escribió en el mensaje Let's try [idCity] as numeric:

DoCmd.OpenForm "Secondary 2", , , "[idCity]=" & Me.choose



Helppp!!! the code dont work! :-(

I choose a value in the combobox and nothing happens .......

for your information, idCity is in another table, not in the one of Cities, reason why the RowSource that I have in combobox is

SELECT dbo_City.id, dbo_City.Description FROM dbo_City ORDER BY [Description]; .......................it has some relation with the problem?

I hope you can help me!!!

Adrian.-

--------------------------------------------------------------------------------



<RuralGuy> escribió en el mensaje Hi Adrian,

The AfterUpdate event of the ComboBox should work:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then just close your form
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub


Hello RuralGuy, thanks for reply!

I dont undertand where I have to put your code .... in the after update event I have this:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"
End Sub

Thanks!

Adrian.-


--------------------------------------------------------------------------------




<RuralGuy> escribió en el mensaje I believe I understand your question. Pass the *where* clause as absolute
information rather than a reference to your form that must now remain open for
the query of the next form.

DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then close your form
DoCmd.Close acForm, Me.Name, acSaveNo


Hello everybody!

I need this precise:

I have 2 Forms, one "initial" and another "Secondary 2"..... In the "initial" there is a ComboBOX (with the code above) in which I choose a "City"... this does that it loaded the "Secondary 2" form just by the data pertaining to the chosen city.


--------------------------------------------------------------------------------

Private Sub choose_AfterUpdate()

DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"

End Sub

--------------------------------------------------------------------------------


Now, which I need is: That when choosing this city once, no longer is possibility of returning to choose another one in the next load.

I hope to have been clear, and sorry for my english!!!

Thanks in advance,

Adrian.-

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
A

Adrian

Thank you very Much Rural Guy!!!!!!!! I already managed to solve it.

Hugs from argentina!

--------------------------------------------------------------------------------

Sure. Zip it up. Use Rural Guy at Wild Blue dot net without any spaces.

Hi again!! Can I send you, my MDB for inspect???


--------------------------------------------------------------------------------

I take it the "Secondary 2" form opens and this one closes but the selection
criteria does not work? You are getting too many records or something?

The original code:
DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"
worked didn't it?

Is [idCity] a Text field? Try:
DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose.Column(0) & "'"


No way ...... :-(


--------------------------------------------------------------------------------


<RuralGuy> escribió en el mensaje Let's try [idCity] as numeric:

DoCmd.OpenForm "Secondary 2", , , "[idCity]=" & Me.choose



Helppp!!! the code dont work! :-(

I choose a value in the combobox and nothing happens .......

for your information, idCity is in another table, not in the one of Cities, reason why the RowSource that I have in combobox is

SELECT dbo_City.id, dbo_City.Description FROM dbo_City ORDER BY [Description]; .......................it has some relation with the problem?

I hope you can help me!!!

Adrian.-

--------------------------------------------------------------------------------



<RuralGuy> escribió en el mensaje Hi Adrian,

The AfterUpdate event of the ComboBox should work:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then just close your form
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub


Hello RuralGuy, thanks for reply!

I dont undertand where I have to put your code .... in the after update event I have this:

Private Sub choose_AfterUpdate()
DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"
End Sub

Thanks!

Adrian.-


--------------------------------------------------------------------------------




<RuralGuy> escribió en el mensaje I believe I understand your question. Pass the *where* clause as absolute
information rather than a reference to your form that must now remain open for
the query of the next form.

DoCmd.OpenForm "Secondary 2", , , "[idCity]='" & Me.choose & "'"
'-- Then close your form
DoCmd.Close acForm, Me.Name, acSaveNo


Hello everybody!

I need this precise:

I have 2 Forms, one "initial" and another "Secondary 2"..... In the "initial" there is a ComboBOX (with the code above) in which I choose a "City"... this does that it loaded the "Secondary 2" form just by the data pertaining to the chosen city.


--------------------------------------------------------------------------------

Private Sub choose_AfterUpdate()

DoCmd.OpenForm "Secondary 2", , , "[idCity]=[forms]![initial]![choose]"

End Sub

--------------------------------------------------------------------------------


Now, which I need is: That when choosing this city once, no longer is possibility of returning to choose another one in the next load.

I hope to have been clear, and sorry for my english!!!

Thanks in advance,

Adrian.-

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
R

RuralGuy

Great to hear. Thanks for posting back.

<snip>

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
Top