Data Type in Textbox

C

channell

Hello,

I recently received some help to a similar question. However, this is a bit
different, and I think it has to do with data types.

In my previous question, from a form, I opened a related form, input
information and records (and at the bottom, there was a locked textbox that
counted the number of records in the opened form), and when I closed this
related form, it put the existing information (record count) into a
textbox(Data type: Number) on the main form.

Well, much like this, I have a main form that I press a button to open a
related form. I input information and in the footer of this related form,
there is a textbox(Sum([Volume])) which keeps a sum of the volume. When I
close this form, I was what is populated in this text box to be in the main
form. It works perfectly with the first example, but this is not working at
all. It is only displaying "0" on the main form, even though the textbox in
the related form displays the sum. What am I doing wrong?

Thank you very much. Here is the Code:

Private Sub Command19_Click()
On Error GoTo Err_Command19_Click
Me.Requery

Forms!fMAINENTRY!fENTRY!txtTotalVolume = Me!txtSumVolume


DoCmd.Close acForm, Me.Name, acSaveNo

Exit_Command19_Click:
Exit Sub

Err_Command19_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command19_Click
End Sub

(really what I have is a Main form with a subform on it. From the subform I
can click a button to open the Related form)

Thank you very much!!

-Scott Channell
 
C

channell

Fix: After working with it for a while longer, I attempted to use a variable-

Dim tVol as Integer

tVol = txtSumVolume

Forms!fMAINENTRY!fENTRY!txtTotalVolume = tVol

(... and then the rest of the code)

It worked perfectly. I apologize for posting questions and then answering
them myself, but I hope someone can find this helpful.

-Scott Channell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top