View Single Post
  #4 (permalink)  
Old 12-09-03, 20:55
saundone saundone is offline
Registered User
 
Join Date: Nov 2002
Posts: 49
Sorry for the delay in resopnding (out of town trip).

Let me see if I can clear some things up.

First,
Set rs = CurrentDb.OpenRecordset("CR_DEFECT") (This is a table?)

The answer to this is yes if that is the table name where your data is. If not, replace it with the correct name.

Second,

Where are you declaring your variables? I have never had good luck declaring them any where but at a global level (the entire project). To see if this will help, create a new module, and add:

Public txtCR_DEFECT As String
Public TEXT_PROMOTION_ID As String

This may cause you a problem since a variable can only be "seen" by another sub or function if it is declared as public or at a high enough level (i.e. at the form level as opposed to a sub routine).

Third,

You must set a variable before you open up a form, or refer to the control (i.e. forms!<form name>... not an effecient way to deal wth things).

Fourth,

Is PROMOTION_ID a field in your table? If not, that may be causing your problems. However, I think if you correct the first 3 steps you will find that this code will run.

Hope this will help.
Reply With Quote