PC Review


Reply
Thread Tools Rate Thread

How to add fields and text boxes and assign control source to the.

 
 
SuperNerd
Guest
Posts: n/a
 
      19th Sep 2008
Hello, I have a form that I have created to do quality inspection on incoming
raw materials. What I want to do with this is to have the inspectors/users
first enter in the quantity recieved. With the quantity of the parts
recieved known, the program will know how many parts the inspector has to
inspect and from that, it will create the correct amount of input text boxes,
along with new fields, for the inpector to input in the inspected data.

In other words:
# of parts recieved will generate new fields and ,equally, text boxes for
inspection data.

for example: if 500 parts were recieved, the inspector will need to inspect
15 of the 500 parts to save time.

sorry for writing so much.
I hope this makes sense and is possible to do in MS Access. PLEASE HELP!!!

thanks dough
 
Reply With Quote
 
 
 
 
code_monkey_number_9
Guest
Posts: n/a
 
      19th Sep 2008
SuperNerd:

I suppose I would approach this by creating a related table to hold
inspection data for recieved products:

tblRecieved
ID | QTY | Data1 | etc

tblInspections
ID | ReceivedID | Data 1 | etc

Then create a subform based on tblInspections, and link it to your main
form. When the user enters a quantity, your code could run on the
after_update event:

Private Sub txtQTY_AfterUpdate()

'get the number of inspections for qty:
'insert whatever function you have for performing this logic
Dim qty as integer
qty = onGetInspectionsRequired (Me.txtQTY)

Dim x as integer
Dim str as string

For x = 1 to qty
str = "Insert Into tblInspections (ID, RecievedID) Values (" & x & ", " &
Me.ID & ");"
DoCmd.RunSQL str
Next

Me.subFrmInspections.Form.Requery 'or whatever. this statement may not be
syntactically correct, but the idea is

End Sub

Private Function onGetInspectionsRequired(qty as integer) as Integer

Select Case qty
Case <= 500
onGetInspectionsRequired = 15
Case > 500
onGetInspectionsRequired = 20
End Select

End Function

"SuperNerd" wrote:

> Hello, I have a form that I have created to do quality inspection on incoming
> raw materials. What I want to do with this is to have the inspectors/users
> first enter in the quantity recieved. With the quantity of the parts
> recieved known, the program will know how many parts the inspector has to
> inspect and from that, it will create the correct amount of input text boxes,
> along with new fields, for the inpector to input in the inspected data.
>
> In other words:
> # of parts recieved will generate new fields and ,equally, text boxes for
> inspection data.
>
> for example: if 500 parts were recieved, the inspector will need to inspect
> 15 of the 500 parts to save time.
>
> sorry for writing so much.
> I hope this makes sense and is possible to do in MS Access. PLEASE HELP!!!
>
> thanks dough

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assign control source to unbound text box TeeSee Microsoft Access Forms 7 13th Jan 2009 12:54 AM
How to assign a control source to a unbound text box Faraa.Oh@gmail.com Microsoft Access 1 3rd Jun 2008 11:00 PM
Assign the Control Source for a Label and a Text Box Dynamically =?Utf-8?B?Um9u?= Microsoft Access Form Coding 2 25th Sep 2006 04:18 PM
text boxes & control source Robert Dieckmann Microsoft Excel Programming 1 5th Dec 2005 05:58 PM
Text boxes and control source Welshy Microsoft Excel Programming 1 18th Nov 2004 12:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:43 PM.