Page 1 of 1

Autofill Text Entry Box

PostPosted: Wed Apr 08, 2015 6:50 am
by bypass666
Hey all

Hopefully somebody can help me stop ripping my hair out here.

Once again this could be very simple but i have tried and tried and failed miserably.

Sooo, i have a button taking me to a page where a new record is to be added to a table using multiple text entry boxes and a save button. The primary key is a unique identifier that is autogenerated. Now in this table a customer ID has to be added which is a primary key from another table, it is a variable to store text entry contents.

Now is there any way that particular text entry box can be populated using information from the curent record selected in the other table and one particular field?

I have tried defining a relationship and all sorts but the closest i can get is a combobox with all company names listed that selects the record in the customer table, but it just displays records from the other table in all of the text entry boxes, and i only want customer ID to be populated.

Is there any command that syncs the information in a field from the currently selected record in one table, with a text entry box that is assigned a variable in another table i guess i'm asking (i think) :) ?

Many thanks and apologies for the long description, i didn't really know how to ask. :D

Re: Autofill Text Entry Box

PostPosted: Wed Apr 08, 2015 10:01 am
by stu
After selecting the user from the user list:

Code: Select all
SetVar "[DB.Invoice.UserID]" "[DB.Users.UserID]"


Possibly the easiest way...

Re: Autofill Text Entry Box

PostPosted: Thu Apr 09, 2015 3:21 am
by bypass666
Hi Stu

Many thanks for that it worked a treat, can't believe it was that simple. If you wouldn't mind I had a couple more short questions?

Can tab selections be changed as when tabbing through for entering data it seems to go backwards (down) or completely random. The only other thing was is there a way to have no record selected prior to entering a page?

Once again thanks for that simple solution I spent so much time trying other things. :roll:

Re: Autofill Text Entry Box

PostPosted: Thu Apr 09, 2015 4:35 am
by stu
For setting the tabbing order select Arrange in the top menu and then Set Tab Order...

For entering to a blank page I would probably suggest not bounding any item to a record in the database, so for example you have 3 TextBox items, their respective variable: [Name], [Phone], [Address]. At the bottom you have a button with an action such as:

Code: Select all
dbpAddRecord "Database" "Customers"
setvar "[Database.Customers.Name]" "[Name]"
setvar "[Database.Customers.Name]" "[Phone]"
setvar "[Database.Customers.Name]" "[Address]"
dbpsaveedits "Database" "Customers"


Let me know.

Re: Autofill Text Entry Box

PostPosted: Mon Apr 13, 2015 11:41 am
by bypass666
Excellent... Once again many thanks Stu that did the trick and also helped with quite a few other things i wanted to do.

I have one more thing if i could trouble you, will probably have to started making new threads instead of asking in this one :D. Is there any way to move a record from one table to another at all? If this isn't an option is there any way to have a checkbox that displays both true and false options when a yes/no field is inserted in Access? Can't seem to get it to display both for some reason.

Thanks again

Re: Autofill Text Entry Box

PostPosted: Mon Apr 13, 2015 11:48 am
by Neosoft Support
Is there any way to move a record from one table to another at all?


Navigate to the record in the source table you want to copy, then create a new record in the destination table. Use SetVar to copy the fields individually from the source table to the dest table. If the table doesn't contain any autoinc fields than you can use dbpRecordToVar and dbpVarToRecord to copy the field data.

If this isn't an option is there any way to have a checkbox that displays both true and false options when a yes/no field is inserted in Access? Can't seem to get it to display both for some reason.


If the field is a boolean type, then you should be able to just set the check box's variable to the field's variable (ie: [DB.Table.Field]).