I have a Cmd button with the following code
Private Sub cmdShowReleaseInfo_Click()
Dim Xdeveloper As String
DoCmd.OpenQuery "ReleaseLetterQry", , acReadOnly
DoCmd.ApplyFilter , "[offsites!VaultId] = " &
[Forms]![frmreleaseletter]![Text4]
Xdeveloper = [Forms]![frmreleaseletter]![Developer]
MsgBox ("Developer = ") & Xdeveloper
I get nothing
Thanks
:
Xaddress = [forms]![frmreleaseletter]![address]
MsgBox "(Address Is) " & Xaddress
Should do it. But, where did you put the code and how do you cause it to
execute?
--
Dave Hargis, Microsoft Access MVP
:
OK but how do I capture the info in the query? There is a field in the query
named 'Address'. I want to pass that info to a variable so I created a
variable named 'Xaddress', I then entered a line of code that said "Xaddress
= [forms]![frmreleaseletter]![address], then the line of code 'msgbox
("Address is ") & Xaddress. I get nothing, not even the msgbox.
:
I am not familiar with using the Word object model, so I guess I may not be
the best person to answer your question; however, if the document is totally
created in Access, and just presented as a word document, you may explore
using the OutputTo method.
--
Dave Hargis, Microsoft Access MVP
:
I have a form with a drop down, it lets the user select which record they
want to select. After selecting the record they press "Continue" and the
query filters out all the records execpt that one, so in the query there is
only one record. Now I want to put the information from that record on a
Word document, then print it. Is this the wrong way to do this??
Thanks
:
Sorry, I don't get the whole picture.
Assigning a query field's value to a variable is not a big deal, but I need
a lot more detail, please.
--
Dave Hargis, Microsoft Access MVP
:
After the filter and I have one record, I'm trying to assign the information
in the query to a variable name.
:
Variables don't show up anywhere unless you assign them to something visible.
What were you expecting?
--
Dave Hargis, Microsoft Access MVP
:
I do a filter using a form that returns a record using the PK. I want to
create a Word doc with the info from the filtered query. I Dimmed some
variables to test, one called xAccountNo and said in the code xAccountNo =
AccountNo, but nothing happens, it does not show up anywhere. Could someone
show me what the code should look like?
Thanks in Advance