Need Query or Macro to Update Form

  • Follow


I have a form with two textboxes, both tied to field names in the table I am 
using for the form.  The two fields are GroupName1 and Groupname2.  I need to 
build a query or macro to run where if there is any text in Groupname2, to 
transfer the text to a new record where the text from Groupname2 is now in 
Groupname1 field.  Please help!!!

Thanks.
0
Reply Utf 2/19/2008 12:53:01 PM

Chris

You've described "how" you want to solve a situation... but we have no idea
what situation this is supposed to solve!

More specific descriptions will probably lead to more specific suggestions.

-- 
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

"Chris J." <ChrisJ@discussions.microsoft.com> wrote in message
news:C5C19018-2DD6-4D7E-8056-466872C7DC34@microsoft.com...
> I have a form with two textboxes, both tied to field names in the table I
am
> using for the form.  The two fields are GroupName1 and Groupname2.  I need
to
> build a query or macro to run where if there is any text in Groupname2, to
> transfer the text to a new record where the text from Groupname2 is now in
> Groupname1 field.  Please help!!!
>
> Thanks.

0
Reply Jeff 2/19/2008 1:39:44 PM


I have an Access database set up to track files in our file room.  I have a 
table named Provider File Tracking Log.  I have a form created based off of 
this table.  In the form, I have a field showing what the file name is 
[Groupname1].  Each record displays the [Groupname1] with locations of where 
the file is at with other fields filled out by team members through the 
department.  When a new file needs to be added to the form, a team member 
will add a new record putting the file name in [Groupname2].  What I need 
accomplished, is at the end of every day, for a query or macro to take all of 
the records with file names in [Groupname2] and implement them into new 
records where the file name would be in [Groupname1].  However, there are a 
ton of fields that have blanks in [Groupname2] which we would not want to 
implement into new records.  We would want to transfer only the records that 
have a name in [Groupname2].  

"Jeff Boyce" wrote:

> Chris
> 
> You've described "how" you want to solve a situation... but we have no idea
> what situation this is supposed to solve!
> 
> More specific descriptions will probably lead to more specific suggestions.
> 
> -- 
> Regards
> 
> Jeff Boyce
> www.InformationFutures.net
> 
> Microsoft Office/Access MVP
> http://mvp.support.microsoft.com/
> 
> Microsoft IT Academy Program Mentor
> http://microsoftitacademy.com/
> 
> "Chris J." <ChrisJ@discussions.microsoft.com> wrote in message
> news:C5C19018-2DD6-4D7E-8056-466872C7DC34@microsoft.com...
> > I have a form with two textboxes, both tied to field names in the table I
> am
> > using for the form.  The two fields are GroupName1 and Groupname2.  I need
> to
> > build a query or macro to run where if there is any text in Groupname2, to
> > transfer the text to a new record where the text from Groupname2 is now in
> > Groupname1 field.  Please help!!!
> >
> > Thanks.
> 
> 
0
Reply Utf 2/19/2008 2:50:05 PM

On Feb 19, 8:50 am, Chris J. <Chr...@discussions.microsoft.com> wrote:
> I have an Access database set up to track files in our file room.  I have a
> table named Provider File Tracking Log.  I have a form created based off of
> this table.  In the form, I have a field showing what the file name is
> [Groupname1].  Each record displays the [Groupname1] with locations of where
> the file is at with other fields filled out by team members through the
> department.  When a new file needs to be added to the form, a team member
> will add a new record putting the file name in [Groupname2].  What I need
> accomplished, is at the end of every day, for a query or macro to take all of
> the records with file names in [Groupname2] and implement them into new
> records where the file name would be in [Groupname1].  However, there are a
> ton of fields that have blanks in [Groupname2] which we would not want to
> implement into new records.  We would want to transfer only the records that
> have a name in [Groupname2].
>
> "Jeff Boyce" wrote:
> > Chris
>
> > You've described "how" you want to solve a situation... but we have no idea
> > what situation this is supposed to solve!
>
> > More specific descriptions will probably lead to more specific suggestions.
>
> > --
> > Regards
>
> > Jeff Boyce
> >www.InformationFutures.net
>
> > Microsoft Office/Access MVP
> >http://mvp.support.microsoft.com/
>
> > Microsoft IT Academy Program Mentor
> >http://microsoftitacademy.com/
>
> > "Chris J." <Chr...@discussions.microsoft.com> wrote in message
> >news:C5C19018-2DD6-4D7E-8056-466872C7DC34@microsoft.com...
> > > I have a form with two textboxes, both tied to field names in the table I
> > am
> > > using for the form.  The two fields are GroupName1 and Groupname2.  I need
> > to
> > > build a query or macro to run where if there is any text in Groupname2, to
> > > transfer the text to a new record where the text from Groupname2 is now in
> > > Groupname1 field.  Please help!!!
>
> > > Thanks.

It sounds like you need to run a two-step procedure. First step is to
do an Append query that identifies all the records in the table with
non-blank [Groupname2] fields and reorganize the other data in the
records into the appropriate fields. I'm not sure if you will have to
run a maketable query to make an intermediate table or if you can
append directly to the same table you run the query from.

Here is a sample of some SQL I have that looks through a table for
specific records (WHERE clause) and then uses the data from some
fields in the table and substitutes different data for other fields
and then APPENDS the result set into the destination table.

SELECT Games1.GameNumber AS GameID, Games1.MatchNumber AS MatchID,
"yes" AS IsBye, Null AS Moves, Null AS BoardPosition, Games1.Black AS
WhiteId, 1 AS WhiteScore, Null AS BlackId, Null AS BlackScore
FROM Games1
WHERE (((Games1.White)=51 Or (Games1.White)=50));

Once you have done this, you can run a DELETE query to delete all the
rows in the table where [GroupName2] is non-blank.

Doesn't sound too complex.
0
Reply MikeB 2/19/2008 3:32:11 PM

3 Replies
396 Views

(page loaded in 0.076 seconds)


Reply: