Jay1b Posted September 8, 2003 Posted September 8, 2003 Hi I am trying to put some data into fieldname, fieldstartpos and fieldendpos, from a form, by: Form Code FieldName = txtFieldName.Text This is in a module. Public Structure FieldRecord ' Create user-defined type. Public FieldName As String Public FieldStartPos As Integer Public FieldEndPos As Integer End Structure Public Field_List() As FieldRecord But the problem i am facing is that is wont recognise fieldname - Could someone please tell me why? Thanks. Quote
*Experts* mutant Posted September 8, 2003 *Experts* Posted September 8, 2003 What do mean it wont recoginze it? There is an error or what? What you have works for me after I initialized the array to a number. Quote
Jay1b Posted September 8, 2003 Author Posted September 8, 2003 I get the blue line underneath the FieldName in the form code, when its typed in. I have enclosed the code in a zip below. The error is half way down the 'Private Sub listFields_SelectedIndexChanged' in the frmOptions form. Thanks.ports.zip Quote
samsmithnz Posted September 8, 2003 Posted September 8, 2003 I can't open up the zip here, cos I'm at work, but try changing the name fieldname to something else, its probably just a reserved word. Quote Thanks Sam http://www.samsmith.co.nz
Administrators PlausiblyDamp Posted September 8, 2003 Administrators Posted September 8, 2003 Looking at the code the problem seems to be that you haven't declared a variable FieldName anywhere in the form, you will need to reference the structure containing the FieldName member. Something like Dim f As FieldRecord f.FieldName = txtFieldName.Text Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Jay1b Posted September 8, 2003 Author Posted September 8, 2003 *bangs head against wall* Thanks - its always the simple things that get me! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.